yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-migration-cleanup-in-error-paths-in-loadvm.patch

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