From: Michal Privoznik Date: Fri, 27 Jan 2023 09:45:50 +0000 (+0100) Subject: qemuProcessStop: Fix detection of outgoing migration for external devices X-Git-Tag: v9.1.0-rc1~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88f0fbf63851c6ae80ad03b2a05a966d8a2f296c;p=thirdparty%2Flibvirt.git qemuProcessStop: Fix detection of outgoing migration for external devices 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 --- 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);