From 80f161598ac548424a2626c980caf5b9f1e1e591 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 22 Mar 2018 13:19:43 -0700 Subject: [PATCH] Backport fix for restoring snapshot more than once (rhbz #1531048) --- ...rather-than-destroy-main_thread_load.patch | 35 +++++++++++++++++++ qemu.spec | 9 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0201-migration-Reset-rather-than-destroy-main_thread_load.patch diff --git a/0201-migration-Reset-rather-than-destroy-main_thread_load.patch b/0201-migration-Reset-rather-than-destroy-main_thread_load.patch new file mode 100644 index 0000000..f3657ab --- /dev/null +++ b/0201-migration-Reset-rather-than-destroy-main_thread_load.patch @@ -0,0 +1,35 @@ +From 5089e1862fe80b6f23ba4c494e2902cbe3d9d48e Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Fri, 25 Aug 2017 15:19:39 +0100 +Subject: [PATCH] migration: Reset rather than destroy main_thread_load_event + +migration_incoming_state_destroy doesn't really destroy, it cleans up. +After a loadvm it's called, but the loadvm command can be run twice, +and so destroying an init-once mutex breaks on the second loadvm. + +Reported-by: Stafford Horne +Signed-off-by: Dr. David Alan Gilbert +Message-Id: <20170825141940.20740-2-dgilbert@redhat.com> +Reviewed-by: Peter Xu +Tested-by: Stafford Horne +Signed-off-by: Dr. David Alan Gilbert +--- + migration/migration.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 1a2b3ebd1a..9838ccc885 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -166,7 +166,7 @@ void migration_incoming_state_destroy(void) + mis->from_src_file = NULL; + } + +- qemu_event_destroy(&mis->main_thread_load_event); ++ qemu_event_reset(&mis->main_thread_load_event); + } + + static void migrate_generate_event(int new_state) +-- +2.16.2 + diff --git a/qemu.spec b/qemu.spec index 95b666c..c91fe89 100644 --- a/qemu.spec +++ b/qemu.spec @@ -104,7 +104,7 @@ Requires: %{name}-block-ssh = %{epoch}:%{version}-%{release} Summary: QEMU is a FAST! processor emulator Name: qemu Version: 2.10.1 -Release: 2%{?rcrel}%{?dist} +Release: 3%{?rcrel}%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -168,6 +168,10 @@ Patch0105: 0105-9pfs-use-g_malloc0-to-allocate-space-for-xattr.patch # (bz #1496882) Patch0106: 0106-io-monitor-encoutput-buffer-size-from-websocket-GSou.patch +# Fix restoring from snapshot more than once in a single run +# (bz #1531048) - backport from master +Patch0201: 0201-migration-Reset-rather-than-destroy-main_thread_load.patch + # documentation deps BuildRequires: texinfo # For /usr/bin/pod2man @@ -2036,6 +2040,9 @@ getent passwd qemu >/dev/null || \ %changelog +* Thu Mar 22 2018 Adam Williamson - 2:2.1.01-3 +- Backport fix for restoring snapshot more than once (rhbz #1531048) + * Thu Dec 21 2017 Daniel P. Berrange - 2:2.10.1-2 - Re-enable RBD on arm/ppc (rhbz #1528378)