From 479ac1e42d4133c0fd29e2db776596a6e9c6a036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 25 Jun 2014 14:46:33 +0200 Subject: [PATCH] core: check libvirt error on specific connection Not global last one. --- core-modules/000QubesVm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index ed9dfe07..0a7bc01b 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -672,7 +672,7 @@ class QubesVm(object): self._libvirt_domain = vmm.libvirt_conn.defineXML(domain_config) self.uuid = uuid.UUID(bytes=self._libvirt_domain.UUID()) except libvirt.libvirtError: - if libvirt.virGetLastError()[0] == libvirt.VIR_ERR_NO_DOMAIN: + if vmm.libvirt_conn.virConnGetLastError()[0] == libvirt.VIR_ERR_NO_DOMAIN: # accept the fact that libvirt doesn't know anything about this # domain... pass @@ -691,7 +691,7 @@ class QubesVm(object): self._libvirt_domain = vmm.libvirt_conn.lookupByName(self.name) self.uuid = uuid.UUID(bytes=self._libvirt_domain.UUID()) except libvirt.libvirtError: - if libvirt.virGetLastError()[0] == libvirt.VIR_ERR_NO_DOMAIN: + if vmm.libvirt_conn.virConnGetLastError()[0] == libvirt.VIR_ERR_NO_DOMAIN: self._update_libvirt_domain() else: raise @@ -1621,7 +1621,7 @@ class QubesVm(object): try: nd.dettach() except libvirt.libvirtError: - if libvirt.virGetLastError()[0] == libvirt.VIR_ERR_INTERNAL_ERROR: + if vmm.libvirt_conn.virConnGetLastError()[0] == libvirt.VIR_ERR_INTERNAL_ERROR: # allready detached pass else: