提交 ce19db89 编写于 作者: D Daniel P. Berrange

Set close-exe on logfile fd, keep monitor FD open

上级 daa2369d
Mon Jul 23 13:59:12 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_driver.c: keep monitor filehandle open, and set
close-on-exec flag for logfiles.
Mon Jul 23 11:36:12 CEST 2007 Daniel Veillard <veillard@redhat.com>
* docs/virsh.pod virsh.1: update to document VIRSH_DEFAULT_CONNECT_URI
......
......@@ -456,6 +456,11 @@ static int qemudOpenMonitor(virConnectPtr conn,
buf, sizeof(buf),
qemudCheckMonitorPrompt,
"monitor");
/* Keep monitor open upon success */
if (ret == 0)
return ret;
error:
close(monfd);
return ret;
......@@ -617,6 +622,14 @@ static int qemudStartVMDaemon(virConnectPtr conn,
logfile, strerror(errno));
return -1;
}
if (qemudSetCloseExec(vm->logfile) < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Unable to set VM logfile close-on-exec flag %s",
strerror(errno));
close(vm->logfile);
vm->logfile = -1;
return -1;
}
if (qemudBuildCommandLine(conn, driver, vm, &argv) < 0) {
close(vm->logfile);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册