提交 5550dde1 编写于 作者: P Peter Krempa

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 a245abce.
上级 5ae7b0d8
...@@ -365,6 +365,8 @@ struct testQemuHotplugCpuData { ...@@ -365,6 +365,8 @@ struct testQemuHotplugCpuData {
static void static void
testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data) testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
{ {
qemuDomainObjPrivatePtr priv;
if (!data) if (!data)
return; return;
...@@ -375,7 +377,13 @@ testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data) ...@@ -375,7 +377,13 @@ testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
VIR_FREE(data->xml_dom); VIR_FREE(data->xml_dom);
if (data->vm) {
priv = data->vm->privateData;
priv->mon = NULL;
virObjectUnref(data->vm); virObjectUnref(data->vm);
}
qemuMonitorTestFree(data->mon); qemuMonitorTestFree(data->mon);
VIR_FREE(data); VIR_FREE(data);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册