[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemu: Add quotes to kernel command line of direct kernel boot

On 08/27/2012 08:05 PM, Zhou Zheng Sheng wrote:
> When passing kernel command line arguments, it is possible to have
> spaces. The arguments should be protected in qoutes.


> If the contents in <cmdline> are passed as-is to qemu, then qemu will see
>   qemu ... -append console=ttyS0 ks=http://example.com/f8-i386/os/ ...

That's what shows in the guest log, because we don't (yet) properly
quote arguments in the log.  But if you look at what we actually pass to
the exec() family,...

>          if (def->os.cmdline)
> -            virCommandAddArgList(cmd, "-append", def->os.cmdline, NULL);

...this code properly passes def->os.cmdline as a single exec()
argument.  Remember, virCommand is NOT subject to further shell
interpretation.  You are getting confused by trying to treat the log
output as though libvirt were invoking /bin/sh to start the command,
instead of calling exec() directly.

If anything, the real bug to fix would be virCommandToString to have a
mode that lists the output with shell quoting as needed, and to use that
mode when outputting log file information.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]