mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
fix migration of paused vms upon failure
This makes a small change on the failed-migration path. Up to now, all VMs that failed non-live migration after the "stop" command were restarted. This must not be done when the VM was paused in the first place. * src/qemu/qemu_driver.c (qemudDomainMigratePerform): Do not restart a paused VM that fails migration. Set paused state after "stop", reset it after failure.
This commit is contained in:
parent
25f7fa0583
commit
ba7d82c699
@ -7401,7 +7401,7 @@ qemudDomainMigratePerform (virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (!(flags & VIR_MIGRATE_LIVE)) {
|
||||
if (!(flags & VIR_MIGRATE_LIVE) && vm->state == VIR_DOMAIN_RUNNING) {
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
/* Pause domain for non-live migration */
|
||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||
@ -7412,6 +7412,7 @@ qemudDomainMigratePerform (virDomainPtr dom,
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
paused = 1;
|
||||
|
||||
vm->state = VIR_DOMAIN_PAUSED;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
|
||||
@ -7459,6 +7460,7 @@ endjob:
|
||||
}
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
|
||||
vm->state = VIR_DOMAIN_RUNNING;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
|
||||
|
Loading…
x
Reference in New Issue
Block a user