mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
libxl: support VIR_MIGRATE_PERSIST_DEST migration flag
By default, virt-manager (and likely other libvirt-based apps) sets the VIR_MIGRATE_PERSIST_DEST flag when invoking the migrate API, which fails in a Xen setup since the libxl driver does not support the flag. Persisting a domain is a trivial task in the grand scheme of migration, so be nice to libvirt apps and add support for VIR_MIGRATE_PERSIST_DEST in the libxl driver. Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
53e3f69b3c
commit
1fc90ae934
@ -1021,6 +1021,29 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
|
|||||||
event = NULL;
|
event = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flags & VIR_MIGRATE_PERSIST_DEST) {
|
||||||
|
unsigned int oldPersist = vm->persistent;
|
||||||
|
virDomainDefPtr vmdef;
|
||||||
|
|
||||||
|
vm->persistent = 1;
|
||||||
|
if (!(vmdef = virDomainObjGetPersistentDef(cfg->caps,
|
||||||
|
driver->xmlopt, vm)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
event = virDomainEventLifecycleNewFromObj(vm,
|
||||||
|
VIR_DOMAIN_EVENT_DEFINED,
|
||||||
|
oldPersist ?
|
||||||
|
VIR_DOMAIN_EVENT_DEFINED_UPDATED :
|
||||||
|
VIR_DOMAIN_EVENT_DEFINED_ADDED);
|
||||||
|
if (event) {
|
||||||
|
libxlDomainEventQueue(driver, event);
|
||||||
|
event = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
# define LIBXL_MIGRATION_FLAGS \
|
# define LIBXL_MIGRATION_FLAGS \
|
||||||
(VIR_MIGRATE_LIVE | \
|
(VIR_MIGRATE_LIVE | \
|
||||||
VIR_MIGRATE_PEER2PEER | \
|
VIR_MIGRATE_PEER2PEER | \
|
||||||
|
VIR_MIGRATE_PERSIST_DEST | \
|
||||||
VIR_MIGRATE_UNDEFINE_SOURCE | \
|
VIR_MIGRATE_UNDEFINE_SOURCE | \
|
||||||
VIR_MIGRATE_PAUSED)
|
VIR_MIGRATE_PAUSED)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user