[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
> 


Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.