From 88f0fbf63851c6ae80ad03b2a05a966d8a2f296c Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 27 Jan 2023 10:45:50 +0100 Subject: [PATCH] qemuProcessStop: Fix detection of outgoing migration for external devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When cleaning up host in qemuProcessStop(), our external helper processes (e.g. swtpm) want to know whether the domain is being migrated out or not (so that they restore seclabels on a device state that's on a shared storage). This fact is reflected in the @outgoingMigration variable which is set to true if asyncJob is anything but VIR_ASYNC_JOB_MIGRATION_IN. Well, we have a specific job for outgoing migration (VIR_ASYNC_JOB_MIGRATION_OUT) and thus we should check for that. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ff219e0030..05503edab5 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8398,7 +8398,7 @@ void qemuProcessStop(virQEMUDriver *driver, qemuDomainCleanupRun(driver, vm); outgoingMigration = (flags & VIR_QEMU_PROCESS_STOP_MIGRATED) && - (asyncJob != VIR_ASYNC_JOB_MIGRATION_IN); + (asyncJob == VIR_ASYNC_JOB_MIGRATION_OUT); qemuExtDevicesStop(driver, vm, outgoingMigration); qemuDBusStop(driver, vm); -- 2.47.2