mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
tests: qemuhotplug: Don't free the monitor object as part of @vm
The test monitor should be freed separately so we need to remove the
pointer from the @vm object. This fixes a race condition crash in the
test introduced in commit a245abce43
.
This commit is contained in:
parent
5ae7b0d8af
commit
5550dde150
@ -365,6 +365,8 @@ struct testQemuHotplugCpuData {
|
||||
static void
|
||||
testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv;
|
||||
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
@ -375,7 +377,13 @@ testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
|
||||
|
||||
VIR_FREE(data->xml_dom);
|
||||
|
||||
virObjectUnref(data->vm);
|
||||
if (data->vm) {
|
||||
priv = data->vm->privateData;
|
||||
priv->mon = NULL;
|
||||
|
||||
virObjectUnref(data->vm);
|
||||
}
|
||||
|
||||
qemuMonitorTestFree(data->mon);
|
||||
VIR_FREE(data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user