qemu-kvm/kvm-migration-Make-migration-blocker-work-for-snapshots-.patch
Miroslav Rezanina 3cb15f8e48 * Fri Nov 19 2021 Miroslav Rezanina <mrezanin@redhat.com> - 6.1.0-7
- kvm-migration-Make-migration-blocker-work-for-snapshots-.patch [bz#1996609]
- kvm-migration-Add-migrate_add_blocker_internal.patch [bz#1996609]
- kvm-dump-guest-memory-Block-live-migration.patch [bz#1996609]
- kvm-spec-Build-the-VDI-block-driver.patch [bz#2013331]
- kvm-spec-Explicitly-include-compress-filter.patch [bz#1980035]
- Resolves: bz#1996609
  (Qemu hit core dump when dump guest memory during live migration)
- Resolves: bz#2013331
  (RFE: qemu-img cannot convert from vdi format)
- Resolves: bz#1980035
  (RFE: Enable compress filter so we can create new, compressed qcow2 files via qemu-nbd)
2021-11-19 02:04:52 -05:00

62 lines
2.3 KiB
Diff

From 0a9b55b44c5c548ff6f3da7335acf2138ecb4376 Mon Sep 17 00:00:00 2001
From: Peter Xu <peterx@redhat.com>
Date: Wed, 22 Sep 2021 12:20:07 -0400
Subject: [PATCH 1/6] migration: Make migration blocker work for snapshots too
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Peter Xu <peterx@redhat.com>
RH-MergeRequest: 51: dump-guest-memory: Add blocker for migration
RH-Commit: [1/3] 241888d12c7197dd4ee1e1ba6e3115f70901636e (peterx/qemu-kvm)
RH-Bugzilla: 1996609
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: quintela1 <quintela@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
save_snapshot() checks migration blocker, which looks sane. At the meantime we
should also teach the blocker add helper to fail if during a snapshot, just
like for migrations.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
(cherry picked from commit 4c170330aae4a4ed75c3a8638b7d4c5d9f365244)
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/migration.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 041b8451a6..f476e2101e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2062,15 +2062,16 @@ int migrate_add_blocker(Error *reason, Error **errp)
return -EACCES;
}
- if (migration_is_idle()) {
- migration_blockers = g_slist_prepend(migration_blockers, reason);
- return 0;
+ /* Snapshots are similar to migrations, so check RUN_STATE_SAVE_VM too. */
+ if (runstate_check(RUN_STATE_SAVE_VM) || !migration_is_idle()) {
+ error_propagate_prepend(errp, error_copy(reason),
+ "disallowing migration blocker "
+ "(migration/snapshot in progress) for: ");
+ return -EBUSY;
}
- error_propagate_prepend(errp, error_copy(reason),
- "disallowing migration blocker "
- "(migration in progress) for: ");
- return -EBUSY;
+ migration_blockers = g_slist_prepend(migration_blockers, reason);
+ return 0;
}
void migrate_del_blocker(Error *reason)
--
2.27.0