mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Run qemu with -help when probing for args
This commit is contained in:
parent
8049357ded
commit
3af422a82e
@ -1,3 +1,8 @@
|
|||||||
|
Wed May 21 15:42:29 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/qemu_conf.c: Run qemu with -help and don't pollute
|
||||||
|
libvirtd environment
|
||||||
|
|
||||||
Tue May 20 12:15:29 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
Tue May 20 12:15:29 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* qemud/qemud.c: Re-factor daemon startup code to avoid
|
* qemud/qemud.c: Re-factor daemon startup code to avoid
|
||||||
|
@ -448,6 +448,9 @@ static int qemudExtractVersionInfo(const char *qemu, int *version, int *flags) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (child == 0) { /* Kid */
|
if (child == 0) { /* Kid */
|
||||||
|
/* Just in case QEMU is translated someday we force to C locale.. */
|
||||||
|
const char *const qemuenv[] = { "LANG=C", NULL };
|
||||||
|
|
||||||
if (close(STDIN_FILENO) < 0)
|
if (close(STDIN_FILENO) < 0)
|
||||||
goto cleanup1;
|
goto cleanup1;
|
||||||
if (close(STDERR_FILENO) < 0)
|
if (close(STDERR_FILENO) < 0)
|
||||||
@ -457,9 +460,9 @@ static int qemudExtractVersionInfo(const char *qemu, int *version, int *flags) {
|
|||||||
if (dup2(newstdout[1], STDOUT_FILENO) < 0)
|
if (dup2(newstdout[1], STDOUT_FILENO) < 0)
|
||||||
goto cleanup1;
|
goto cleanup1;
|
||||||
|
|
||||||
/* Just in case QEMU is translated someday.. */
|
/* Passing -help, rather than relying on no-args which doesn't
|
||||||
setenv("LANG", "C", 1);
|
always work */
|
||||||
execl(qemu, qemu, (char*)NULL);
|
execle(qemu, qemu, "-help", (char*)NULL, qemuenv);
|
||||||
|
|
||||||
cleanup1:
|
cleanup1:
|
||||||
_exit(-1); /* Just in case */
|
_exit(-1); /* Just in case */
|
||||||
|
Loading…
Reference in New Issue
Block a user