From f500d44492d07fceaee5ba793722cb71d29858a1 Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 23 Aug 2022 15:24:00 +0300 Subject: [PATCH] Optimize snapshot capabilities to snap UEFI type machines. by @qrwitu --- vrtManager/instance.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vrtManager/instance.py b/vrtManager/instance.py index b2a8dd2..f392402 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -1215,10 +1215,20 @@ class wvmInstance(wvmConnect): name, time.time(), ) + self.change_snapshot_xml() xml += self._XMLDesc(VIR_DOMAIN_XML_SECURE) xml += """0 """ self._snapshotCreateXML(xml, 0) + self.recover_snapshot_xml() + + def change_snapshot_xml(self): + xml_temp = self._XMLDesc(VIR_DOMAIN_XML_SECURE).replace("","") + self._defineXML(xml_temp) + + def recover_snapshot_xml(self): + xml_temp = self._XMLDesc(VIR_DOMAIN_XML_SECURE).replace("","") + self._defineXML(xml_temp) def get_snapshot(self): snapshots = [] @@ -1234,8 +1244,10 @@ class wvmInstance(wvmConnect): snap.delete(0) def snapshot_revert(self, snapshot): + self.change_snapshot_xml() snap = self.instance.snapshotLookupByName(snapshot, 0) self.instance.revertToSnapshot(snap, 0) + self.recover_snapshot_xml() def get_managed_save_image(self): return self.instance.hasManagedSaveImage(0)