[PATCH v5 2/2] qemuDomainRevertToSnapshot: save domain configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 src/qemu/qemu_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a0d6596..edf39d9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15546,6 +15546,15 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
     } else if (snap) {
         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) {
         qemuDomainEventQueue(driver, event);
         qemuDomainEventQueue(driver, event2);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]