From: Christoph Egger Subject: [PATCH] libxl: fix guest networking Date: Wed, 12 Jan 2011 15:55:01 +0100 Message-ID: <201101121555.03215.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_HDcLNtZwuPiKS5T" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_HDcLNtZwuPiKS5T Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! 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 -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_HDcLNtZwuPiKS5T Content-Type: text/x-diff; charset="iso 8859-15"; name="xen_libxl_tapif.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_libxl_tapif.diff" Content-Description: xen_libxl_tapif.diff diff -r 1db44b952f52 tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Wed Jan 12 11:29:30 2011 +0100 +++ b/tools/libxl/libxl_dm.c Wed Jan 12 15:45:30 2011 +0100 @@ -28,6 +28,15 @@ #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, libxl_device_nic *vifs, @@ -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++; } } --Boundary-00=_HDcLNtZwuPiKS5T Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_HDcLNtZwuPiKS5T--