debuggers.hg

changeset 22812:b7b29f51205f

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@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Christoph Egger <Christoph.Egger@amd.com>
date Mon Jan 17 17:18:38 2011 +0000 (2011-01-17)
parents 0dbad563a659
children 7f6d529b5f4f
files tools/libxl/libxl_dm.c
line diff
     1.1 --- a/tools/libxl/libxl_dm.c	Mon Jan 17 17:14:20 2011 +0000
     1.2 +++ b/tools/libxl/libxl_dm.c	Mon Jan 17 17:18:38 2011 +0000
     1.3 @@ -28,6 +28,15 @@
     1.4  #include "libxl.h"
     1.5  #include "flexarray.h"
     1.6  
     1.7 +static const char *libxl_tapif_script(libxl__gc *gc)
     1.8 +{
     1.9 +#ifdef __linux__
    1.10 +    return libxl__strdup(gc, "no");
    1.11 +#else
    1.12 +    return libxl__sprintf(gc, "%s/qemu-ifup", libxl_xen_script_dir_path());
    1.13 +#endif
    1.14 +}
    1.15 +
    1.16  static char ** libxl_build_device_model_args_old(libxl__gc *gc,
    1.17                                               libxl_device_model_info *info,
    1.18                                               libxl_device_nic *vifs,
    1.19 @@ -129,8 +138,9 @@ static char ** libxl_build_device_model_
    1.20                  flexarray_vappend(dm_args,
    1.21                                  "-net", libxl__sprintf(gc, "nic,vlan=%d,macaddr=%s,model=%s",
    1.22                                                         vifs[i].devid, smac, vifs[i].model),
    1.23 -                                "-net", libxl__sprintf(gc, "tap,vlan=%d,ifname=%s,bridge=%s,script=no",
    1.24 -                                                       vifs[i].devid, ifname, vifs[i].bridge), NULL);
    1.25 +                                "-net", libxl__sprintf(gc, "tap,vlan=%d,ifname=%s,bridge=%s,script=%s",
    1.26 +                                                       vifs[i].devid, ifname, vifs[i].bridge, libxl_tapif_script(gc)),
    1.27 +                                NULL);
    1.28                  ioemu_vifs++;
    1.29              }
    1.30          }
    1.31 @@ -261,8 +271,8 @@ static char ** libxl_build_device_model_
    1.32                  flexarray_append(dm_args, libxl__sprintf(gc, "nic,vlan=%d,macaddr=%s,model=%s",
    1.33                              vifs[i].devid, smac, vifs[i].model));
    1.34                  flexarray_append(dm_args, "-net");
    1.35 -                flexarray_append(dm_args, libxl__sprintf(gc, "tap,vlan=%d,ifname=%s,script=no",
    1.36 -                            vifs[i].devid, ifname));
    1.37 +                flexarray_append(dm_args, libxl__sprintf(gc, "tap,vlan=%d,ifname=%s,script=%s",
    1.38 +                            vifs[i].devid, ifname, libxl_tapif_script(gc)));
    1.39                  ioemu_vifs++;
    1.40              }
    1.41          }