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

[Xen-changelog] [xen-unstable] libxl: fix guest networking on NetBSD



# HG changeset patch
# User Christoph Egger <Christoph.Egger@xxxxxxx>
# Date 1295284718 0
# Node ID b7b29f51205fa910a71ee992ab6b17c152d0f67c
# Parent  0dbad563a6592addd1d757afa41b3960d0862270
libxl: fix guest networking on NetBSD

As previously reported when I start guests with xl then the
guest network does not work because the qemu-ifup script
no longer runs.

NetBSD doesn't have something like udev. Changing xm/xend,
libxl and xenbackendd to make everything behave the same way
is a lot more intrusive than enabling it for NetBSD again.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_dm.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff -r 0dbad563a659 -r b7b29f51205f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Mon Jan 17 17:14:20 2011 +0000
+++ b/tools/libxl/libxl_dm.c    Mon Jan 17 17:18:38 2011 +0000
@@ -27,6 +27,15 @@
 #include "libxl_internal.h"
 #include "libxl.h"
 #include "flexarray.h"
+
+static const char *libxl_tapif_script(libxl__gc *gc)
+{
+#ifdef __linux__
+    return libxl__strdup(gc, "no");
+#else
+    return libxl__sprintf(gc, "%s/qemu-ifup", libxl_xen_script_dir_path());
+#endif
+}
 
 static char ** libxl_build_device_model_args_old(libxl__gc *gc,
                                              libxl_device_model_info *info,
@@ -129,8 +138,9 @@ static char ** libxl_build_device_model_
                 flexarray_vappend(dm_args,
                                 "-net", libxl__sprintf(gc, 
"nic,vlan=%d,macaddr=%s,model=%s",
                                                        vifs[i].devid, smac, 
vifs[i].model),
-                                "-net", libxl__sprintf(gc, 
"tap,vlan=%d,ifname=%s,bridge=%s,script=no",
-                                                       vifs[i].devid, ifname, 
vifs[i].bridge), NULL);
+                                "-net", libxl__sprintf(gc, 
"tap,vlan=%d,ifname=%s,bridge=%s,script=%s",
+                                                       vifs[i].devid, ifname, 
vifs[i].bridge, libxl_tapif_script(gc)),
+                                NULL);
                 ioemu_vifs++;
             }
         }
@@ -261,8 +271,8 @@ static char ** libxl_build_device_model_
                 flexarray_append(dm_args, libxl__sprintf(gc, 
"nic,vlan=%d,macaddr=%s,model=%s",
                             vifs[i].devid, smac, vifs[i].model));
                 flexarray_append(dm_args, "-net");
-                flexarray_append(dm_args, libxl__sprintf(gc, 
"tap,vlan=%d,ifname=%s,script=no",
-                            vifs[i].devid, ifname));
+                flexarray_append(dm_args, libxl__sprintf(gc, 
"tap,vlan=%d,ifname=%s,script=%s",
+                            vifs[i].devid, ifname, libxl_tapif_script(gc)));
                 ioemu_vifs++;
             }
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.