mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Set close-exe on logfile fd, keep monitor FD open
This commit is contained in:
parent
daa2369dde
commit
ce19db8990
@ -1,3 +1,8 @@
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user