mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
qemuDomainRevertToSnapshot: save domain configuration
Reverting to a snapshot may change domain configuration. New configuration should be saved if domain has persistent flag. VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT is emitted in case of configuration update.
This commit is contained in:
parent
8047d45704
commit
c5e81090ea
@ -15546,6 +15546,15 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
} else if (snap) {
|
} else if (snap) {
|
||||||
snap->def->current = false;
|
snap->def->current = false;
|
||||||
}
|
}
|
||||||
|
if (ret == 0 && config && vm->persistent &&
|
||||||
|
!(ret = virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||||
|
vm->newDef ? vm->newDef : vm->def))) {
|
||||||
|
detail = VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT;
|
||||||
|
qemuDomainEventQueue(driver,
|
||||||
|
virDomainEventLifecycleNewFromObj(vm,
|
||||||
|
VIR_DOMAIN_EVENT_DEFINED,
|
||||||
|
detail));
|
||||||
|
}
|
||||||
if (event) {
|
if (event) {
|
||||||
qemuDomainEventQueue(driver, event);
|
qemuDomainEventQueue(driver, event);
|
||||||
qemuDomainEventQueue(driver, event2);
|
qemuDomainEventQueue(driver, event2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user