]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Double mutex unlock in qemuDomainModifyDeviceFlags
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Thu, 17 Jan 2013 17:25:28 +0000 (18:25 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 17 Jan 2013 18:57:00 +0000 (11:57 -0700)
The driver mutex was unlocked in qemuDomainModifyDeviceFlags before
entering qemuDomainObjBeginJobWithDriver where it will be unlocked once
more leaving it in an undefined state. The result was that two
threads were simultaneously looking up the domain hash table during
multiple parallel device attach/detach operations.
Luckily this triggered a virHashIterationError.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/qemu/qemu_driver.c

index 8c39864cc62286b265d25780c8d19b2780dc6b0f..c28c2236b727c8d8da503dfb380adaea0dec6b0f 100644 (file)
@@ -6443,7 +6443,6 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
 
     qemuDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
-    qemuDriverUnlock(driver);
     if (!vm) {
         char uuidstr[VIR_UUID_STRING_BUFLEN];
         virUUIDFormat(dom->uuid, uuidstr);