From: Daniel P. Berrange Date: Wed, 13 Jan 2010 17:09:41 +0000 (+0000) Subject: Add missing call to re-attach host devices if VM startup fails X-Git-Tag: v0.7.6~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2a2ba71b4025bdb034361c3178479706db9fddd;p=thirdparty%2Flibvirt.git Add missing call to re-attach host devices if VM startup fails If there is a problem with VM startup, PCI devices may be left assigned to pci-stub / pci-back. Adding a call to reattach host devices in the cleanup path is required. * qemu/qemu_driver.c: qemuDomainReAttachHostDevices() when VM startup fails --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3495499f97..7c77321737 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2749,6 +2749,8 @@ cleanup: /* We jump here if we failed to start the VM for any reason * XXX investigate if we can kill this block and safely call * qemudShutdownVMDaemon even though no PID is running */ + qemuDomainReAttachHostDevices(conn, driver, vm->def); + if (driver->securityDriver && driver->securityDriver->domainRestoreSecurityAllLabel) driver->securityDriver->domainRestoreSecurityAllLabel(conn, vm);