ae23c9
From 020674a9569df103bdd6a8cef29ce8013c92a8b8 Mon Sep 17 00:00:00 2001
ae23c9
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ae23c9
Date: Mon, 1 Oct 2018 10:54:49 +0100
ae23c9
Subject: [PATCH 03/28] migration: cleanup in error paths in loadvm
ae23c9
ae23c9
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
Message-id: <20181001105449.41090-3-dgilbert@redhat.com>
ae23c9
Patchwork-id: 82325
ae23c9
O-Subject: [RHEL-8.0 qemu-kvm PATCH 2/2] migration: cleanup in error paths in loadvm
ae23c9
Bugzilla: 1608765
ae23c9
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
ae23c9
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
ae23c9
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ae23c9
ae23c9
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ae23c9
ae23c9
There's a couple of error paths in qemu_loadvm_state
ae23c9
which happen early on but after we've initialised the
ae23c9
load state; that needs to be cleaned up otherwise
ae23c9
we can hit asserts if the state gets reinitialised later.
ae23c9
ae23c9
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
Message-Id: <20180914170430.54271-3-dgilbert@redhat.com>
ae23c9
Reviewed-by: Peter Xu <peterx@redhat.com>
ae23c9
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
(cherry picked from commit 096c83b7219c5a2145435afc8be750281e9cb447)
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 migration/savevm.c | 2 ++
ae23c9
 1 file changed, 2 insertions(+)
ae23c9
ae23c9
diff --git a/migration/savevm.c b/migration/savevm.c
ae23c9
index 6a8d363..edb3b94 100644
ae23c9
--- a/migration/savevm.c
ae23c9
+++ b/migration/savevm.c
ae23c9
@@ -2145,11 +2145,13 @@ int qemu_loadvm_state(QEMUFile *f)
ae23c9
     if (migrate_get_current()->send_configuration) {
ae23c9
         if (qemu_get_byte(f) != QEMU_VM_CONFIGURATION) {
ae23c9
             error_report("Configuration section missing");
ae23c9
+            qemu_loadvm_state_cleanup();
ae23c9
             return -EINVAL;
ae23c9
         }
ae23c9
         ret = vmstate_load_state(f, &vmstate_configuration, &savevm_state, 0);
ae23c9
 
ae23c9
         if (ret) {
ae23c9
+            qemu_loadvm_state_cleanup();
ae23c9
             return ret;
ae23c9
         }
ae23c9
     }
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9