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

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

When passing kernel command line arguments, it is possible to have
spaces. The arguments should be protected in qoutes.

In http://libvirt.org/formatdomain.html "direct kernel boot" section,
there is an example.
    <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
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/ ...
It must be quoted, so let qemu see
  qemu ... -append "console=ttyS0 ks=http://example.com/f8-i386/os/"; ...

Signed-off-by: Zhou Zheng Sheng <zhshzhou linux vnet ibm com>
 src/qemu/qemu_command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8c32a4d..80b562d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4849,7 +4849,7 @@ qemuBuildCommandLine(virConnectPtr conn,
         if (def->os.initrd)
             virCommandAddArgList(cmd, "-initrd", def->os.initrd, NULL);
         if (def->os.cmdline)
-            virCommandAddArgList(cmd, "-append", def->os.cmdline, NULL);
+            virCommandAddArgList(cmd, "-append", "\"", def->os.cmdline, "\"", NULL);
     } else {
         virCommandAddArgList(cmd, "-bootloader", def->os.bootloader, NULL);

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