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

Run qemu with -help when probing for args

上级 8049357d
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>
* 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 */
/* Just in case QEMU is translated someday we force to C locale.. */
const char *const qemuenv[] = { "LANG=C", NULL };
if (close(STDIN_FILENO) < 0)
goto cleanup1;
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)
goto cleanup1;
/* Just in case QEMU is translated someday.. */
setenv("LANG", "C", 1);
execl(qemu, qemu, (char*)NULL);
/* Passing -help, rather than relying on no-args which doesn't
always work */
execle(qemu, qemu, "-help", (char*)NULL, qemuenv);
cleanup1:
_exit(-1); /* Just in case */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册