diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index aa050227..a1c62a8e 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -609,6 +609,15 @@ class QubesVm(object): # Don't check retcode - it always will fail when backend domain is down subprocess.call(["/usr/sbin/xl", "network-detach", self.name, m.group(1)], stderr=subprocess.PIPE) + # Wait for device destroy + tries = 0 + path = "'{0}/device/vif/0/state".format(xs.get_domain_path(self.xid)) + while xs.read(path): + time.sleep(0.1) + tries += 1 + if tries > 10: + # timeout + break def create_xenstore_entries(self, xid): if dry_run: