提交 a7d1eb3c 编写于 作者: D Daniel Veillard

Fix a couple of problems in last patch

Those were pointed by DanB in his review but not yet fixed

* src/qemu/qemu_driver.c: qemudWaitForMonitor() use EnterMonitorWithDriver()
  and ExitMonitorWithDriver() there
* src/qemu/qemu_monitor_text.c: checking fro strdu failure and hash
  table add error in qemuMonitorTextGetPtyPaths()
上级 60e8977f
......@@ -1534,10 +1534,10 @@ qemudWaitForMonitor(virConnectPtr conn,
goto cleanup;
}
qemuDomainObjEnterMonitor(vm);
qemuDomainObjEnterMonitorWithDriver(driver, vm);
qemuDomainObjPrivatePtr priv = vm->privateData;
ret = qemuMonitorGetPtyPaths(priv->mon, paths);
qemuDomainObjExitMonitor(vm);
qemuDomainObjExitMonitorWithDriver(driver, vm);
VIR_DEBUG("qemuMonitorGetPtyPaths returned %i", ret);
if (ret == 0) {
......
......@@ -1650,9 +1650,19 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
/* Path is everything after needle to the end of the line */
*eol = '\0';
char *path = needle + strlen(NEEDLE);
char *path = strdup(needle + strlen(NEEDLE));
if (path == NULL) {
virReportOOMError(NULL);
goto cleanup;
}
virHashAddEntry(paths, id, strdup(path));
if (virHashAddEntry(paths, id, path) < 0) {
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
_("failed to save chardev path '%s'"),
path);
VIR_FREE(path);
goto cleanup;
}
#undef NEEDLE
next:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册