]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
migration: cleanup in error paths in loadvm
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 14 Sep 2018 17:04:30 +0000 (18:04 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 26 Sep 2018 16:29:01 +0000 (17:29 +0100)
There's a couple of error paths in qemu_loadvm_state
which happen early on but after we've initialised the
load state; that needs to be cleaned up otherwise
we can hit asserts if the state gets reinitialised later.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180914170430.54271-3-dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/savevm.c

index d35e87b88caa0656a7cacd43ec4151539baea7ad..2d10e45582ada083e959bc6ad517a109e0a674ca 100644 (file)
@@ -2333,11 +2333,13 @@ int qemu_loadvm_state(QEMUFile *f)
     if (migrate_get_current()->send_configuration) {
         if (qemu_get_byte(f) != QEMU_VM_CONFIGURATION) {
             error_report("Configuration section missing");
+            qemu_loadvm_state_cleanup();
             return -EINVAL;
         }
         ret = vmstate_load_state(f, &vmstate_configuration, &savevm_state, 0);
 
         if (ret) {
+            qemu_loadvm_state_cleanup();
             return ret;
         }
     }