Marek Marczykowski
2013-May-08 04:45 UTC
[PATCH] libxl: make nic ''bridge'' parameter optional - do not fill default
Do not set ''bridge'' parameter - let vif-bridge script to do autodetection. Actually ''network-bridge'' never creates xenbr0 interface by default, so defaulting bridge to xenbr0 is senseless. Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com> --- tools/libxl/libxl.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 6bb9c24..03fd35a 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2811,10 +2811,6 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic, nic->mac[4] = r[1]; nic->mac[5] = r[2]; } - if (!nic->bridge) { - nic->bridge = strdup("xenbr0"); - if (!nic->bridge) return ERROR_NOMEM; - } if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge", libxl__xen_script_dir_path()) < 0 ) return ERROR_FAIL; @@ -2918,8 +2914,10 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid, nic->rate_interval_usecs)); } - flexarray_append(back, "bridge"); - flexarray_append(back, libxl__strdup(gc, nic->bridge)); + if (nic->bridge) { + flexarray_append(back, "bridge"); + flexarray_append(back, libxl__strdup(gc, nic->bridge)); + } flexarray_append(back, "handle"); flexarray_append(back, libxl__sprintf(gc, "%d", nic->devid)); flexarray_append(back, "type"); -- 1.8.1.4
Ian Campbell
2013-May-08 09:31 UTC
Re: [PATCH] libxl: make nic ''bridge'' parameter optional - do not fill default
On Wed, 2013-05-08 at 05:45 +0100, Marek Marczykowski wrote:> Do not set ''bridge'' parameter - let vif-bridge script to do > autodetection. Actually ''network-bridge'' never creates xenbr0 interface > by default, so defaulting bridge to xenbr0 is senseless.Using network-bridge is not supported/recommended with xl and most of our docs do use xenbr0. That said the change seems like a reasonable one to me, however you haven''t made a case for 4.3 inclusion or CCd the release manager. Ian.> > Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com> > --- > tools/libxl/libxl.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index 6bb9c24..03fd35a 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -2811,10 +2811,6 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic, > nic->mac[4] = r[1]; > nic->mac[5] = r[2]; > } > - if (!nic->bridge) { > - nic->bridge = strdup("xenbr0"); > - if (!nic->bridge) return ERROR_NOMEM; > - } > if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge", > libxl__xen_script_dir_path()) < 0 ) > return ERROR_FAIL; > @@ -2918,8 +2914,10 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid, > nic->rate_interval_usecs)); > } > > - flexarray_append(back, "bridge"); > - flexarray_append(back, libxl__strdup(gc, nic->bridge)); > + if (nic->bridge) { > + flexarray_append(back, "bridge"); > + flexarray_append(back, libxl__strdup(gc, nic->bridge)); > + } > flexarray_append(back, "handle"); > flexarray_append(back, libxl__sprintf(gc, "%d", nic->devid)); > flexarray_append(back, "type");
Seemingly Similar Threads
- [PATCH V3] libxl: write IO ABI for disk frontends
- [PATCH] libxl: use preferred syntax for network device creation with upstream qemu
- [PATCH] libxl: Set VNC password through QMP
- [PATCH] libxl: fix usage of backend parameter and run_hotplug_scripts
- [PATCH] libxl: vcpu_avail is a bitmask, use it as such