aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorScott Cheloha <cheloha@linux.vnet.ibm.com>2019-10-17 15:59:52 -0500
committerJuan Quintela <quintela@redhat.com>2020-01-20 09:10:22 +0100
commitbd5de61e7b926b5bb9dae254630bf3c8be575bc0 (patch)
tree17ca4a3b5da855e03cc1fb833c8c28b6266c0b52 /migration
parent619bd31d1f7cc5878e75e989a78d6f1c79356d4a (diff)
downloadqemu-bd5de61e7b926b5bb9dae254630bf3c8be575bc0.zip
qemu-bd5de61e7b926b5bb9dae254630bf3c8be575bc0.tar.gz
qemu-bd5de61e7b926b5bb9dae254630bf3c8be575bc0.tar.bz2
migration: add savevm_state_handler_remove()
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 <cheloha@linux.vnet.ibm.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/savevm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index 59efc19..30d980c 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);
}