mirror of https://gitee.com/openkylin/libvirt.git
conf: net: Fix deadlock if assignment of network def fails
When the assignment fails, the network object is not unlocked and next call that would use it deadlocks.
This commit is contained in:
parent
947230fb56
commit
f823089124
|
@ -295,6 +295,7 @@ virNetworkAssignDef(virNetworkObjListPtr nets,
|
|||
|
||||
if ((network = virNetworkFindByName(nets, def->name))) {
|
||||
if (virNetworkObjAssignDef(network, def, live) < 0) {
|
||||
virNetworkObjUnlock(network);
|
||||
return NULL;
|
||||
}
|
||||
return network;
|
||||
|
|
Loading…
Reference in New Issue