libxl: simple fix to enable user to configure vif names
This feature is required by some of our users.
PATCH 1/2 libxl: print out vifname in create dryrun.
--- tools/libxl/xl_cmdimpl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
tools/libxl/xl_cmdimpl.c +2 -0
@@ -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);
Signature · 1 line
1.7.2.5
PATCH 2/2 libxl: write vifname in xenstore if set.
In reply to Wei LiuSimple fix to enable user to specify vif names.
--- tools/libxl/libxl.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
tools/libxl/libxl.c +6 -0
@@ -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)));
Signature · 1 line
1.7.2.5
Hi Wei,
2011/12/29 Wei Liu <[email protected]>:
Quoted 4 lines
This feature is required by some of our users.
Reported-by Andy Smith <[email protected]>Reported-by Florian Heigl <[email protected]>
Wow, thank you! :))
Signature · 3 lines
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.
Quoted 10 lines · Florian Heigl
Hi Wei,
2011/12/29 Wei Liu <[email protected]>:
Quoted 4 lines
This feature is required by some of our users.
Reported-by Andy Smith <[email protected]>Reported-by Florian Heigl <[email protected]>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.
Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
In reply to Wei LiuQuoted 1 line · Wei Liu
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).
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
Quoted 21 lines
--- tools/libxl/libxl.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)tools/libxl/libxl.c +6
-0@@ -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)));
Re: [PATCH 1/2] libxl: print out vifname in create dryrun.
In reply to Wei LiuQuoted 1 line · Wei Liu
Signed-off-by Wei Liu <[email protected]>
Quoted 17 lines
--- tools/libxl/xl_cmdimpl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)tools/libxl/xl_cmdimpl.c +2
-0@@ -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);
Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
In reply to Ian CampbellQuoted 6 lines · Ian Campbell
Quoted 1 line · Wei Liu
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.
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.
libxl/libxl.c +0 -0
@@ -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],
libxl/xl_cmdimpl.c +2 -0
@@ -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:
Quoted 14 lines · Ian Campbell
Quoted 6 lines · Wei Liu
Quoted 1 line
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.
Quoted 8 lines
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · Wei Liu
This feature is required by some of our users.
Reported-by Andy Smith <[email protected]>Reported-by Florian Heigl <[email protected]>
Ian, ping?
Wei.
Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
In reply to Ian CampbellIan Campbell writes ("Re: [Xen-devel] [PATCH 2/2] libxl: write vifname in xenstore if set."):
Quoted 2 lines · Wei Liu
Quoted 1 line
Simple fix to enable user to specify vif names.
...
Quoted 2 lines
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>Acked-by Ian Campbell <[email protected]>
both