Re: [Xen-devel] [PATCH] libxl: execute command by execvp()

Yu Zhiguo
2010-07-21T07:11:45Z

Hi Ian,

Yu Zhiguo wrote:
> execute command by execvp() so can search command in PATH.
>

 It is trivial, but can you ack this fix?
 Before this fix, when create guest, we must use absolute path
for bootloader, e.g. bootloader = "/usr/bin/pygrub".
 If not in absolute path now, xl create will block in:

    pid = fork_exec_bootloader(&bootloader_fd, (char
*)info->u.pv.bootloader, args);
 ...
    while (1) {
        fifo_fd = open(fifo, O_RDONLY); ------------> here

 because pygrub cannot be executed so no data will be outputted into this fifo.

Yu

> Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
>
> diff -r 12f0618400de -r da4c3756920e tools/libxl/libxl_exec.c
> --- a/tools/libxl/libxl_exec.c	Fri Jul 16 13:54:44 2010 +0100
> +++ b/tools/libxl/libxl_exec.c	Tue Jul 20 02:14:44 2010 +0800
> @@ -53,7 +53,7 @@
>      /* in case our caller set it to IGN.  subprocesses are entitled
>       * to assume they got DFL. */
>
> -    execv(arg0, args);
> +    execvp(arg0, args);
>      _exit(-1);
>  }
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel