[virt-tools-list] [virt-manager][PATCH 0/2] Delete a VM from the Details Window

Leonardo Augusto Guimarães Garcia lagarcia at linux.vnet.ibm.com
Wed Jun 5 19:19:20 UTC 2013


On 06/05/2013 04:02 PM, lagarcia at linux.vnet.ibm.com wrote:
> From: Leonardo Garcia <lagarcia at br.ibm.com>
>
> This patch set introduces an option in the vmmDetails window to delete
> the VM whose details are currently shown on the present details window.
>
> Leonardo Garcia (2):
>    Add preference to ask for confirmation while deleting a running VM.
>    Add delete VM option in console viewer.
>
>   data/org.virt-manager.virt-manager.gschema.xml |    6 +++
>   ui/vmm-details.ui                              |   15 ++++++++
>   ui/vmm-preferences.ui                          |   31 ++++++++++++++++
>   virtManager/baseclass.py                       |    5 ++-
>   virtManager/config.py                          |    4 ++
>   virtManager/details.py                         |   11 +++++-
>   virtManager/engine.py                          |   46 +++++++++++++++++++++++-
>   virtManager/preferences.py                     |    7 ++++
>   8 files changed, 120 insertions(+), 5 deletions(-)
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
>
While working on this patch set I faced the following issue:

---------------------------------------------------

2013-06-01 23:35:43,103 (details:570): Showing VM details: <vmmDomain 
object at 0x4169d20 (virtManager+domain+vmmDomain at 0x451c2a0)>
2013-06-01 23:35:43,973 (engine:324): window counter incremented to 2
2013-06-01 23:35:51,481 (delete:74): Showing delete wizard
2013-06-01 23:35:58,085 (asyncjob:193): Creating async job for function 
cb=<bound method vmmDeleteDialog._async_delete of <vmmDeleteDialog 
object at 0x7f7aa87ee780 (virtManager+delete+vmmDeleteDialog at 0x40b6e20)>>
2013-06-01 23:35:58,292 (delete:173): Threading off connection to delete 
vol.
2013-06-01 23:35:58,367 (delete:179): Deleting path: 
/var/lib/libvirt/images/Fedora18-test-clone.img
2013-06-01 23:35:58,468 (delete:187): Removing VM 'Fedora18-test-clone'
2013-06-01 23:35:59,213 (delete:83): Closing delete wizard
2013-06-01 23:35:59,656 (cliutils:87): Uncaught exception:
Traceback (most recent call last):
   File "/home/laggarcia/src/git/virt-manager/virtManager/manager.py", 
line 972, in vm_resources_sampled
     row[ROW_STATUS] = vm.run_status()
   File "/home/laggarcia/src/git/virt-manager/virtManager/domain.py", 
line 1501, in run_status
     if self.hasSavedImage():
   File "/home/laggarcia/src/git/virt-manager/virtManager/domain.py", 
line 1235, in hasSavedImage
     return self._backend.hasManagedSaveImage(0)
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 803, in 
hasManagedSaveImage
     if ret == -1: raise libvirtError ('virDomainHasManagedSaveImage() 
failed', dom=self)
libvirtError: Domain not found: no domain with matching uuid 
'421fb315-16a7-a649-3a87-47f776600b4c'

Traceback (most recent call last):
   File "/home/laggarcia/src/git/virt-manager/virtManager/manager.py", 
line 972, in vm_resources_sampled
     row[ROW_STATUS] = vm.run_status()
   File "/home/laggarcia/src/git/virt-manager/virtManager/domain.py", 
line 1501, in run_status
     if self.hasSavedImage():
   File "/home/laggarcia/src/git/virt-manager/virtManager/domain.py", 
line 1235, in hasSavedImage
     return self._backend.hasManagedSaveImage(0)
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 803, in 
hasManagedSaveImage
     if ret == -1: raise libvirtError ('virDomainHasManagedSaveImage() 
failed', dom=self)
libvirt.libvirtError: Domain not found: no domain with matching uuid 
'421fb315-16a7-a649-3a87-47f776600b4c'
2013-06-01 23:35:59,802 (cliutils:87): Uncaught exception:
Traceback (most recent call last):
   File "/home/laggarcia/src/git/virt-manager/virtManager/details.py", 
line 2587, in refresh_resources
     self.vm.refresh_xml()
   File 
"/home/laggarcia/src/git/virt-manager/virtManager/libvirtobject.py", 
line 115, in refresh_xml
     self._xml = self._XMLDesc(self._active_xml_flags)
   File "/home/laggarcia/src/git/virt-manager/virtManager/domain.py", 
line 924, in _XMLDesc
     return self._backend.XMLDesc(flags)
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 381, in 
XMLDesc
     if ret is None: raise libvirtError ('virDomainGetXMLDesc() failed', 
dom=self)
libvirtError: Domain not found: no domain with matching uuid 
'421fb315-16a7-a649-3a87-47f776600b4c'

Traceback (most recent call last):
   File "/home/laggarcia/src/git/virt-manager/virtManager/details.py", 
line 2587, in refresh_resources
     self.vm.refresh_xml()
   File 
"/home/laggarcia/src/git/virt-manager/virtManager/libvirtobject.py", 
line 115, in refresh_xml
     self._xml = self._XMLDesc(self._active_xml_flags)
   File "/home/laggarcia/src/git/virt-manager/virtManager/domain.py", 
line 924, in _XMLDesc
     return self._backend.XMLDesc(flags)
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 381, in 
XMLDesc
     if ret is None: raise libvirtError ('virDomainGetXMLDesc() failed', 
dom=self)
libvirt.libvirtError: Domain not found: no domain with matching uuid 
'421fb315-16a7-a649-3a87-47f776600b4c'
2013-06-01 23:35:59,866 (details:587): Closing VM details: <vmmDomain 
object at 0x4169d20 (virtManager+domain+vmmDomain at 0x451c2a0)>
2013-06-01 23:35:59,886 (engine:328): window counter decremented to 1

---------------------------------------------------

To reproduce this issue, someone have to, with the manager window 
opened, open the console viewer for a non-running VM and then, on the 
manager window, delete the VM with the console viewer window opened. The 
uncaught exception is not always thrown, however. It seems it is only 
thrown when a race condition happens: the resources-sampled signal is 
emitted, triggering both vmmManager.vm_resources_sampled and 
vmmDetials.refresh_resources; however, between the time the signal is 
emitted and the routines are run, the VM is deleted, causing the above 
exceptions.

I'll be working to fix this race condition.

Best regards,

Leonardo Garcia




More information about the virt-tools-list mailing list