From 7e355c5dad80b9a33d32ffac496d0940777edbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 31 Aug 2013 00:29:11 +0200 Subject: [PATCH] core: ignore error when PCI device already "detached" This can be the case at startup, when all network devices are connected to pciback module by initramfs. --- core-modules/000QubesVm.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index 4c88fd8b..8bb3efe3 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -1597,7 +1597,14 @@ class QubesVm(object): # Bind pci devices to pciback driver for pci in self.pcidevs: nd = vmm.libvirt_conn.nodeDeviceLookupByName('pci_0000_' + pci.replace(':','_').replace('.','_')) - nd.dettach() + try: + nd.dettach() + except libvirt.libvirtError: + if libvirt.virGetLastError()[0] == libvirt.VIR_ERR_INTERNAL_ERROR: + # allready detached + pass + else: + raise self.libvirt_domain.createWithFlags(libvirt.VIR_DOMAIN_START_PAUSED)