Subject: virtManager: domain: allow disk only snapshots From: Pavel Hrdina phrdina@redhat.com Tue Jan 23 14:21:24 2024 +0100 Date: Mon Mar 25 13:21:50 2024 +0100: Git: f1ba012e8ff6967b0cd634ab2f9ad1315a136a90 This is used for external snapshots when the VM is offline. Signed-off-by: Pavel Hrdina diff --git a/virtManager/details/snapshots.py b/virtManager/details/snapshots.py index 2665b4b5..a5c25131 100644 --- a/virtManager/details/snapshots.py +++ b/virtManager/details/snapshots.py @@ -234,7 +234,7 @@ class vmmSnapshotNew(vmmGObjectUI): def _do_create_snapshot(self, asyncjob, xml, name, mime, sndata): ignore = asyncjob - self.vm.create_snapshot(xml) + self.vm.create_snapshot(xml, diskOnly=False) try: cachedir = self.vm.get_cache_dir() diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py index c5443c52..e5a81edd 100644 --- a/virtManager/object/domain.py +++ b/virtManager/object/domain.py @@ -1189,11 +1189,13 @@ class vmmDomain(vmmLibvirtObject): if will_be_running: self._async_set_time() - def create_snapshot(self, xml, redefine=False): + def create_snapshot(self, xml, redefine=False, diskOnly=False): flags = 0 if redefine: flags = (flags | libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) else: + if diskOnly: + flags = (flags | libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) log.debug("Creating snapshot flags=%s xml=\n%s", flags, xml) self._backend.snapshotCreateXML(xml, flags)