提交 5140a2f6 编写于 作者: A Adam Litke 提交者: Daniel Veillard

Fix locking in qemudDomainMemoryStats

When adding domainMemoryStats API support for the qemu driver, I didn't
follow the locking rules exactly.  The job condition must be held when
executing monitor commands.  This corrects the segfaults I was seeing
when calling domainMemoryStats in a multi-threaded environment.

* src/qemu/qemu_driver.c: in qemudDomainMemoryStats() add missing
  calls to qemuDomainObjBeginJob/qemuDomainObjEndJob
上级 ecb5cf7c
......@@ -7708,6 +7708,9 @@ qemudDomainMemoryStats (virDomainPtr dom,
goto cleanup;
}
if (qemuDomainObjBeginJob(vm) < 0)
goto cleanup;
if (virDomainObjIsActive(vm)) {
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuDomainObjEnterMonitor(vm);
......@@ -7718,6 +7721,9 @@ qemudDomainMemoryStats (virDomainPtr dom,
"%s", _("domain is not running"));
}
if (qemuDomainObjEndJob(vm) == 0)
vm = NULL;
cleanup:
if (vm)
virDomainObjUnlock(vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册