[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/30] migration: add savevm_state_handler_remove()
From: |
Juan Quintela |
Subject: |
[PULL 13/30] migration: add savevm_state_handler_remove() |
Date: |
Tue, 14 Jan 2020 13:52:37 +0100 |
From: Scott Cheloha <address@hidden>
Create a function to abstract common logic needed when removing a
SaveStateEntry element from the savevm_state.handlers queue.
For now we just remove the element. Soon it will involve additional
cleanup.
Signed-off-by: Scott Cheloha <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/savevm.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 59efc1981d..30d980caa2 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -725,6 +725,11 @@ static void savevm_state_handler_insert(SaveStateEntry
*nse)
}
}
+static void savevm_state_handler_remove(SaveStateEntry *se)
+{
+ QTAILQ_REMOVE(&savevm_state.handlers, se, entry);
+}
+
/* TODO: Individual devices generally have very little idea about the rest
of the system, so instance_id should be removed/replaced.
Meanwhile pass -1 as instance_id if you do not already have a clearly
@@ -777,7 +782,7 @@ void unregister_savevm(VMStateIf *obj, const char *idstr,
void *opaque)
QTAILQ_FOREACH_SAFE(se, &savevm_state.handlers, entry, new_se) {
if (strcmp(se->idstr, id) == 0 && se->opaque == opaque) {
- QTAILQ_REMOVE(&savevm_state.handlers, se, entry);
+ savevm_state_handler_remove(se);
g_free(se->compat);
g_free(se);
}
@@ -841,7 +846,7 @@ void vmstate_unregister(VMStateIf *obj, const
VMStateDescription *vmsd,
QTAILQ_FOREACH_SAFE(se, &savevm_state.handlers, entry, new_se) {
if (se->vmsd == vmsd && se->opaque == opaque) {
- QTAILQ_REMOVE(&savevm_state.handlers, se, entry);
+ savevm_state_handler_remove(se);
g_free(se->compat);
g_free(se);
}
--
2.24.1
- [PULL 03/30] migration-test: Add migration multifd test, (continued)
- [PULL 03/30] migration-test: Add migration multifd test, Juan Quintela, 2020/01/14
- [PULL 04/30] migration: Make sure that we don't call write() in case of error, Juan Quintela, 2020/01/14
- [PULL 05/30] migration-test: introduce functions to handle string parameters, Juan Quintela, 2020/01/14
- [PULL 06/30] migration-test: ppc64: fix FORTH test program, Juan Quintela, 2020/01/14
- [PULL 07/30] runstate: ignore finishmigrate -> prelaunch transition, Juan Quintela, 2020/01/14
- [PULL 08/30] ram.c: remove unneeded labels, Juan Quintela, 2020/01/14
- [PULL 09/30] migration: Rate limit inside host pages, Juan Quintela, 2020/01/14
- [PULL 10/30] migration: Fix incorrect integer->float conversion caught by clang, Juan Quintela, 2020/01/14
- [PULL 11/30] migration: Fix the re-run check of the migrate-incoming command, Juan Quintela, 2020/01/14
- [PULL 12/30] misc: use QEMU_IS_ALIGNED, Juan Quintela, 2020/01/14
- [PULL 13/30] migration: add savevm_state_handler_remove(),
Juan Quintela <=
- [PULL 14/30] migration: savevm_state_handler_insert: constant-time element insertion, Juan Quintela, 2020/01/14
- [PULL 15/30] migration/ram: Yield periodically to the main loop, Juan Quintela, 2020/01/14
- [PULL 16/30] migration/postcopy: reduce memset when it is zero page and matches_target_page_size, Juan Quintela, 2020/01/14
- [PULL 17/30] migration/postcopy: wait for decompress thread in precopy, Juan Quintela, 2020/01/14
- [PULL 18/30] migration/postcopy: count target page number to decide the place_needed, Juan Quintela, 2020/01/14
- [PULL 19/30] migration/postcopy: set all_zero to true on the first target page, Juan Quintela, 2020/01/14
- [PULL 20/30] migration/postcopy: enable random order target page arrival, Juan Quintela, 2020/01/14
- [PULL 21/30] migration/postcopy: enable compress during postcopy, Juan Quintela, 2020/01/14
- [PULL 22/30] migration/multifd: clean pages after filling packet, Juan Quintela, 2020/01/14
- [PULL 23/30] migration/multifd: not use multifd during postcopy, Juan Quintela, 2020/01/14