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.
static void
testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
{
+ qemuDomainObjPrivatePtr priv;
+
if (!data)
return;
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);
}