slirp: fix guestfwd id
authorAlexander Graf <agraf@suse.de>
Sat, 4 Jun 2011 05:25:59 +0000 (07:25 +0200)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Wed, 8 Jun 2011 08:04:29 +0000 (09:04 +0100)
When using -net user,guestfwd=... Qemu immediately complains about the id
being in invalid format. This is because we pass in an id that contains a
colon, while the id restrictions don't allow colons.

This patch changes the colon into a dot, making guestfwd work again.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
net/slirp.c

index e387a116add022b75510ed6ba772649c6e208f6c..e057a14ce991c39b19e35a80d0e1a29c36584f74 100644 (file)
@@ -614,7 +614,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
     }
 
     fwd = qemu_malloc(sizeof(struct GuestFwd));
-    snprintf(buf, sizeof(buf), "guestfwd.tcp:%d", port);
+    snprintf(buf, sizeof(buf), "guestfwd.tcp.%d", port);
     fwd->hd = qemu_chr_open(buf, p, NULL);
     if (!fwd->hd) {
         error_report("could not open guest forwarding device '%s'", buf);