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

Eric Blake eblake at redhat.com
Tue Aug 28 04:06:53 UTC 2012


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.

NACK.


> 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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120827/748f5bf4/attachment-0001.sig>


More information about the libvir-list mailing list