xen/24459-libxl-vifname.patch

31 lines
1.2 KiB
Diff
Raw Normal View History

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1325783613 0
# Node ID caf9753d4cc100183eeda26d00c8c38f14215651
# Parent 19ac027a3c311159dc0f3696d6e571314f0bf0c3
libxl: write vifname in xenstore if set.
Simple fix to enable user to specify vif names.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Index: xen-4.1.2-testing/tools/libxl/libxl.c
===================================================================
--- xen-4.1.2-testing.orig/tools/libxl/libxl.c
+++ xen-4.1.2-testing/tools/libxl/libxl.c
@@ -1233,6 +1233,12 @@ int libxl_device_nic_add(libxl_ctx *ctx,
flexarray_append(back, libxl__sprintf(&gc, "%02x:%02x:%02x:%02x:%02x:%02x",
nic->mac[0], nic->mac[1], nic->mac[2],
nic->mac[3], nic->mac[4], nic->mac[5]));
+
+ if (nic->ifname) {
+ flexarray_append(back, "vifname");
+ flexarray_append(back, nic->ifname);
+ }
+
if (nic->ip) {
flexarray_append(back, "ip");
flexarray_append(back, libxl__strdup(&gc, nic->ip));