Richard W.M. Jones
2009-Sep-22 09:41 UTC
[Libguestfs] [PATCH] Change handling of spaces on Linux kernel command line
-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From 38588ad8f237f1a9987c832add6ed8ca07177194 Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at trick.home.annexia.org> Date: Tue, 22 Sep 2009 10:41:05 +0100 Subject: [PATCH] Change handling of spaces on Linux kernel command line. --- src/guestfs.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 60be453..ee867f5 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -1072,7 +1072,7 @@ guestfs__launch (guestfs_h *g) add_cmdline (g, "user,vlan=0,net=10.0.2.0/8"); snprintf (buf, sizeof buf, - "guestfs_vmchannel=tcp:10.0.2.2:%d ", null_vmchannel_sock); + "guestfs_vmchannel=tcp:10.0.2.2:%d", null_vmchannel_sock); vmchannel = strdup (buf); } @@ -1102,7 +1102,7 @@ guestfs__launch (guestfs_h *g) add_cmdline (g, "-net"); add_cmdline (g, buf); - vmchannel = "guestfs_vmchannel=tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT " "; + vmchannel = "guestfs_vmchannel=tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT; } /* Not guestfwd. HOPEFULLY this qemu uses the older -net channel @@ -1117,7 +1117,7 @@ guestfs__launch (guestfs_h *g) add_cmdline (g, "-net"); add_cmdline (g, "user,vlan=0,net=10.0.2.0/8"); - vmchannel = "guestfs_vmchannel=tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT " "; + vmchannel = "guestfs_vmchannel=tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT; } add_cmdline (g, "-net"); add_cmdline (g, "nic,model=" NET_IF ",vlan=0"); @@ -1133,13 +1133,13 @@ guestfs__launch (guestfs_h *g) /* Linux kernel command line. */ snprintf (buf, sizeof buf, LINUX_CMDLINE - "%s" /* (selinux) */ - "%s" /* (vmchannel) */ - "%s" /* (verbose) */ + "%s " /* (selinux) */ + "%s " /* (vmchannel) */ + "%s " /* (verbose) */ "%s", /* (append) */ - g->selinux ? "selinux=1 enforcing=0 " : "selinux=0 ", + g->selinux ? "selinux=1 enforcing=0" : "selinux=0", vmchannel ? vmchannel : "", - g->verbose ? "guestfs_verbose=1 " : "", + g->verbose ? "guestfs_verbose=1" : "", g->append ? g->append : ""); add_cmdline (g, "-kernel"); -- 1.6.2.5
Jim Meyering
2009-Sep-22 10:54 UTC
[Libguestfs] [PATCH] Change handling of spaces on Linux kernel command line
Richard W.M. Jones wrote: ...> Subject: [PATCH] Change handling of spaces on Linux kernel command line....> + "%s " /* (selinux) */ > + "%s " /* (vmchannel) */ > + "%s " /* (verbose) */ > "%s", /* (append) */ > - g->selinux ? "selinux=1 enforcing=0 " : "selinux=0 ", > + g->selinux ? "selinux=1 enforcing=0" : "selinux=0", > vmchannel ? vmchannel : "", > - g->verbose ? "guestfs_verbose=1 " : "", > + g->verbose ? "guestfs_verbose=1" : "",ACK. Nice to have them all in one place. Thanks.
Possibly Parallel Threads
- [PATCH] Enable new-style -chardev ... guestfwd command line
- [PATCH] Remove explicit guestfs=10.0.2.4:6666 kernel command line parameter.
- [PATCH 00/10] Remove the need for vmchannel
- [PATCH] Allow selinux=? and enforcing=? kernel flags to be controlled
- [PATCH 0/3] RFC: Allow use of external QEMU process with libguestfs