mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-13 14:44:42 -05:00
qemu: fix nwfilter deadlock in qemuProcessReconnect
The correct lock order is: nwfilter driver lock (not used in this code path) nwfilter update lock virt driver lock (not used in this code path) domain object lock but the current code have this order: domain object lock nwfilter update lock Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
@@ -6813,8 +6813,6 @@ qemuProcessReconnect(void *opaque)
|
||||
if (qemuDomainMasterKeyReadFile(priv) < 0)
|
||||
goto error;
|
||||
|
||||
virNWFilterReadLockFilterUpdates();
|
||||
|
||||
VIR_DEBUG("Reconnect monitor to %p '%s'", obj, obj->def->name);
|
||||
|
||||
/* XXX check PID liveliness & EXE path */
|
||||
@@ -7043,6 +7041,8 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
|
||||
memcpy(data, src, sizeof(*data));
|
||||
data->obj = obj;
|
||||
|
||||
virNWFilterReadLockFilterUpdates();
|
||||
|
||||
/* this lock and reference will be eventually transferred to the thread
|
||||
* that handles the reconnect */
|
||||
virObjectLock(obj);
|
||||
@@ -7068,6 +7068,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
|
||||
qemuDomainRemoveInactive(src->driver, obj);
|
||||
|
||||
virDomainObjEndAPI(&obj);
|
||||
virNWFilterUnlockFilterUpdates();
|
||||
virObjectUnref(data->conn);
|
||||
VIR_FREE(data);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user