render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
acda74
From 102efebe3cd2bfebace026744a7835309cf124fa Mon Sep 17 00:00:00 2001
acda74
Message-Id: <102efebe3cd2bfebace026744a7835309cf124fa@dist-git>
acda74
From: Michal Privoznik <mprivozn@redhat.com>
acda74
Date: Fri, 27 Jan 2023 10:45:50 +0100
acda74
Subject: [PATCH] qemuProcessStop: Fix detection of outgoing migration for
acda74
 external devices
acda74
MIME-Version: 1.0
acda74
Content-Type: text/plain; charset=UTF-8
acda74
Content-Transfer-Encoding: 8bit
acda74
acda74
When cleaning up host in qemuProcessStop(), our external helper
acda74
processes (e.g. swtpm) want to know whether the domain is being
acda74
migrated out or not (so that they restore seclabels on a device
acda74
state that's on a shared storage).
acda74
acda74
This fact is reflected in the @outgoingMigration variable which
acda74
is set to true if asyncJob is anything but
acda74
VIR_ASYNC_JOB_MIGRATION_IN. Well, we have a specific job for
acda74
outgoing migration (VIR_ASYNC_JOB_MIGRATION_OUT) and thus we
acda74
should check for that.
acda74
acda74
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
acda74
Reviewed-by: Ján Tomko <jtomko@redhat.com>
acda74
(cherry picked from commit 88f0fbf63851c6ae80ad03b2a05a966d8a2f296c)
acda74
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2161557
acda74
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
acda74
---
acda74
 src/qemu/qemu_process.c | 2 +-
acda74
 1 file changed, 1 insertion(+), 1 deletion(-)
acda74
acda74
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
acda74
index 29716ecb19..2de87211fb 100644
acda74
--- a/src/qemu/qemu_process.c
acda74
+++ b/src/qemu/qemu_process.c
acda74
@@ -8397,7 +8397,7 @@ void qemuProcessStop(virQEMUDriver *driver,
acda74
     qemuDomainCleanupRun(driver, vm);
acda74
 
acda74
     outgoingMigration = (flags & VIR_QEMU_PROCESS_STOP_MIGRATED) &&
acda74
-        (asyncJob != VIR_ASYNC_JOB_MIGRATION_IN);
acda74
+        (asyncJob == VIR_ASYNC_JOB_MIGRATION_OUT);
acda74
     qemuExtDevicesStop(driver, vm, outgoingMigration);
acda74
 
acda74
     qemuDBusStop(driver, vm);
acda74
-- 
acda74
2.39.1
acda74