This feature is required by some of our users. Reported-by: Andy Smith <andy@strugglers.net> Reported-by: Florian Heigl <florian.heigl@gmail.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/xl_cmdimpl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 8270f34..8da8b88 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -419,6 +419,8 @@ static void printf_info(int domid, for (i = 0; i < d_config->num_vifs; i++) { printf("\t(device\n"); printf("\t\t(vif\n"); + if (d_config->vifs[i].ifname) + printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname); printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid); printf("\t\t\t(frontend_domid %d)\n", domid); printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid); -- 1.7.2.5
Simple fix to enable user to specify vif names. Signed-off-by: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/libxl.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 2b8f8f4..3c086d5 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1534,6 +1534,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic) libxl_xen_script_dir_path(), nic->script)); } + + if (nic->ifname) { + flexarray_append(back, "vifname"); + flexarray_append(back, nic->ifname); + } + flexarray_append(back, "mac"); flexarray_append(back,libxl__sprintf(gc, LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac))); -- 1.7.2.5
Florian Heigl
2011-Dec-31 15:01 UTC
Re: libxl: simple fix to enable user to configure vif names
Hi Wei, 2011/12/29 Wei Liu <wei.liu2@citrix.com>:> This feature is required by some of our users. > > Reported-by: Andy Smith <andy@strugglers.net> > Reported-by: Florian Heigl <florian.heigl@gmail.com>Wow, thank you! :)) -- the purpose of libvirt is to provide an abstraction layer hiding all xen features added since 2006 until they were finally understood and copied by the kvm devs.
On Sat, 2011-12-31 at 15:01 +0000, Florian Heigl wrote:> Hi Wei, > > 2011/12/29 Wei Liu <wei.liu2@citrix.com>: > > This feature is required by some of our users. > > > > Reported-by: Andy Smith <andy@strugglers.net> > > Reported-by: Florian Heigl <florian.heigl@gmail.com> > > Wow, thank you! :)) >Hi Florian Have you tested these patches (patch 2 is essential)? Do they work for you? I only took a glimpse of the code, I thought they should work. If you encounter any further issue, please let me know. Wei.
Ian Campbell
2012-Jan-03 10:16 UTC
Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:> Simple fix to enable user to specify vif names.Thanks. It is worth noting that the naming of the vif is implemented by the hotplug scripts and not by netback (which always uses vifX.Y).> Signed-off-by: Wei Liu <wei.liu2@citrix.com>Acked-by: Ian Campbell <Ian.Campbell@citrix.com>> --- > tools/libxl/libxl.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index 2b8f8f4..3c086d5 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -1534,6 +1534,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic) > libxl_xen_script_dir_path(), > nic->script)); > } > + > + if (nic->ifname) { > + flexarray_append(back, "vifname"); > + flexarray_append(back, nic->ifname); > + } > + > flexarray_append(back, "mac"); > flexarray_append(back,libxl__sprintf(gc, > LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
Ian Campbell
2012-Jan-03 10:16 UTC
Re: [PATCH 1/2] libxl: print out vifname in create dryrun.
On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:> Signed-off-by: Wei Liu <wei.liu2@citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > tools/libxl/xl_cmdimpl.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 8270f34..8da8b88 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -419,6 +419,8 @@ static void printf_info(int domid, > for (i = 0; i < d_config->num_vifs; i++) { > printf("\t(device\n"); > printf("\t\t(vif\n"); > + if (d_config->vifs[i].ifname) > + printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname); > printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid); > printf("\t\t\t(frontend_domid %d)\n", domid); > printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);
On Tue, 2012-01-03 at 10:16 +0000, Ian Campbell wrote:> On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote: > > Simple fix to enable user to specify vif names. > > Thanks. It is worth noting that the naming of the vif is implemented by > the hotplug scripts and not by netback (which always uses vifX.Y). >Yes, I knew that after digging into hotplug scripts. :) It seems that we need to backport these patches to earlier versions as well. Wei.
Florian Manschwetus
2012-Jan-03 16:20 UTC
Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
This applies against 4.1.2, but untested, as I still have my Athlon X2 xen boot trouble. diff --git tools/libxl/libxl.c tools/libxl/libxl.c index 2b8f8f4..3c086d5 100644 --- tools/libxl/libxl.c +++ tools/libxl/libxl.c @@ -1229,6 +1229,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic) flexarray_append(back, libxl__sprintf(&gc, "%d", 1)); flexarray_append(back, "script"); flexarray_append(back, nic->script); + + if (nic->ifname) { + flexarray_append(back, "vifname"); + flexarray_append(back, nic->ifname); + } + flexarray_append(back, "mac"); flexarray_append(back, libxl__sprintf(&gc, "%02x:%02x:%02x:%02x:%02x:%02x", nic->mac[0], nic->mac[1], nic->mac[2], diff --git tools/libxl/xl_cmdimpl.c tools/libxl/xl_cmdimpl.c index 8270f34..8da8b88 100644 --- tools/libxl/xl_cmdimpl.c +++ tools/libxl/xl_cmdimpl.c @@ -393,6 +393,8 @@ for (i = 0; i < d_config->num_vifs; i++) { printf("\t(device\n"); printf("\t\t(vif\n"); + if (d_config->vifs[i].ifname) + printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname); printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid); printf("\t\t\t(frontend_domid %d)\n", domid); printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid); Am 03.01.2012 11:39, schrieb Wei Liu:> On Tue, 2012-01-03 at 10:16 +0000, Ian Campbell wrote: >> On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote: >>> Simple fix to enable user to specify vif names. >> >> Thanks. It is worth noting that the naming of the vif is implemented by >> the hotplug scripts and not by netback (which always uses vifX.Y). >> > > Yes, I knew that after digging into hotplug scripts. :) > > It seems that we need to backport these patches to earlier versions as > well. > > > Wei. > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:> This feature is required by some of our users. > > Reported-by: Andy Smith <andy@strugglers.net> > Reported-by: Florian Heigl <florian.heigl@gmail.com> >Ian, ping? Wei.
Ian Jackson
2012-Jan-05 17:14 UTC
Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
Ian Campbell writes ("Re: [Xen-devel] [PATCH 2/2] libxl: write vifname in xenstore if set."):> On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote: > > Simple fix to enable user to specify vif names....> > Signed-off-by: Wei Liu <wei.liu2@citrix.com> > Acked-by: Ian Campbell <Ian.Campbell@citrix.com>both Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>