The function virUnrefConnect() may call virReleaseConnect() to release
the dest connection, and the function virReleaseConnect() will call
conn->driver->close().
So the function virUnrefConnect() should be surrounded by
qemuDomainObjEnterRemoteWithDriver() and
qemuDomainObjExitRemoteWithDriver() to prevent possible deadlock between
two communicating libvirt daemons.
See commit
f0c8e1cb3774d6f09e2681ca1988bf235a343007 for further details.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
cleanup:
VIR_FREE(dom_xml);
/* don't call virConnectClose(), because that resets any pending errors */
+ qemuDomainObjEnterRemoteWithDriver(driver, vm);
virUnrefConnect(dconn);
+ qemuDomainObjExitRemoteWithDriver(driver, vm);
return ret;
}