virt-manager/virtman-delete-fix.diff

25 lines
861 B
Diff
Raw Normal View History

Subject: domain: Remove managed save state before delete
From: Cole Robinson crobinso@redhat.com Mon Aug 29 14:03:50 2011 -0400
Date: Mon Aug 29 14:03:50 2011 -0400:
Git: b36ec4b8c2ec7ed72404db7f71cadfaecfea719e
Newer libvirt forbids 'undefine' in this case
Index: virt-manager-0.9.0/src/virtManager/domain.py
===================================================================
--- virt-manager-0.9.0.orig/src/virtManager/domain.py
+++ virt-manager-0.9.0/src/virtManager/domain.py
@@ -1055,6 +1055,11 @@ class vmmDomain(vmmLibvirtObject):
self.force_update_status()
def delete(self):
+ if self.hasSavedImage():
+ try:
+ self._backend.managedSaveRemove(0)
+ except:
+ logging.exception("Failed to remove managed save state")
self._backend.undefine()
def resume(self):