mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemuMigrationSrcBeginPhase: Don't call 'qemuBlockNodesEnsureActive' with offline VM
Commits7b5566ce67andf879d5f403( v11.8.0-92-gf879d5f403 ) moved around code for re-activating block backends after migration. While previously it was done when migration failed now we do it when we need qemu to do some block operations. 'qemuBlockNodesEnsureActive' is thus called also when 'VIR_MIGRATE_OFFLINE' is used. This doesn't cause failure similar to previous patch only due to a conincidence as 'qemuCaps' wasn't initialized yet and thus we assume that QEMU doesn't support 'blockdev-set-active' and skip all monitor code. Make the code more robust and explicit by calling 'qemuBlockNodesEnsureActive' only on active VMs during migration. Fixes:7b5566ce67Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
1 parent
59fde80f39
commit
4537c0b870
1 file changed
+2
-1
@@ -2899,7 +2899,8 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
vm->newDef && !qemuDomainVcpuHotplugIsInOrder(vm->newDef)))
|
||||
cookieFlags |= QEMU_MIGRATION_COOKIE_CPU_HOTPLUG;
|
||||
|
||||
if (qemuBlockNodesEnsureActive(vm, vm->job->asyncJob) < 0)
|
||||
if (virDomainObjIsActive(vm) &&
|
||||
qemuBlockNodesEnsureActive(vm, vm->job->asyncJob) < 0)
|
||||
return NULL;
|
||||
|
||||
return qemuMigrationSrcBeginXML(vm, xmlin,
|
||||
|
||||
Reference in new issue
Block a user