summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-07-21 16:01:04 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-07-21 16:01:04 +0100
commit10258cadd0067cb49b89faf1ce424b1c01f5a7c3 (patch)
tree87ef159d8a30a20be4cc7e14b7f4c485b5985b43 /src
parentb2ae7ed6e67b3cf596e1000ec5219bbefb6123dd (diff)
downloadlibguestfs-10258cadd0067cb49b89faf1ce424b1c01f5a7c3.tar.gz
libguestfs-10258cadd0067cb49b89faf1ce424b1c01f5a7c3.tar.xz
libguestfs-10258cadd0067cb49b89faf1ce424b1c01f5a7c3.zip
Add commented-out support for alternate guestfwd syntax.
This commit just moves code around. The new support is not enabled because it doesn't work. See qemu-devel, subject "guestfwd option doesn't allow supplementary ,server,nowait"
Diffstat (limited to 'src')
-rw-r--r--src/guestfs.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index fa8a5fc3..db6db910 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -1038,11 +1038,6 @@ guestfs_launch (guestfs_h *g)
*/
g->cmdline[0] = g->qemu;
- /* Construct the -net channel parameter for qemu. */
- snprintf (vmchannel, sizeof vmchannel,
- "channel,%d:unix:%s,server,nowait",
- VMCHANNEL_PORT, unixsock);
-
#define LINUX_CMDLINE \
"panic=1 " /* force kernel to panic if daemon exits */ \
"console=ttyS0 " /* serial console */ \
@@ -1071,10 +1066,38 @@ guestfs_launch (guestfs_h *g)
add_cmdline (g, "-nographic");
add_cmdline (g, "-serial");
add_cmdline (g, "stdio");
- add_cmdline (g, "-net");
- add_cmdline (g, vmchannel);
- add_cmdline (g, "-net");
- add_cmdline (g, "user,vlan=0");
+
+#if 0
+ /* Doesn't work. See:
+ * http://lists.gnu.org/archive/html/qemu-devel/2009-07/threads.html
+ * Subject "guestfwd option doesn't allow supplementary ,server,nowait"
+ */
+ if (qemu_supports (g, "guestfwd")) {
+ /* New-style -net user,guestfwd=... syntax for vmchannel. See:
+ * http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=c92ef6a22d3c71538fcc48fb61ad353f7ba03b62
+ */
+ snprintf (vmchannel, sizeof vmchannel,
+ "user,vlan=0,guestfwd=tcp:%s:%d-unix:%s,server,nowait",
+ VMCHANNEL_ADDR, VMCHANNEL_PORT, unixsock);
+
+ add_cmdline (g, "-net");
+ add_cmdline (g, vmchannel);
+ } else {
+#endif
+ /* Not guestfwd. HOPEFULLY this qemu uses the older -net channel
+ * syntax, or if not then we'll get a quick failure.
+ */
+ snprintf (vmchannel, sizeof vmchannel,
+ "channel,%d:unix:%s,server,nowait",
+ VMCHANNEL_PORT, unixsock);
+
+ add_cmdline (g, "-net");
+ add_cmdline (g, vmchannel);
+ add_cmdline (g, "-net");
+ add_cmdline (g, "user,vlan=0");
+#if 0
+ }
+#endif
add_cmdline (g, "-net");
add_cmdline (g, "nic,model=virtio,vlan=0");