]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuProcessStop: Fix detection of outgoing migration for external devices
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 27 Jan 2023 09:45:50 +0000 (10:45 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 6 Feb 2023 15:33:26 +0000 (16:33 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index ff219e0030756a1d13e8dd28329fc2ce4466879a..05503edab50270eb8dc5b61cc080edd897f26b5c 100644 (file)
@@ -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);