]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: set net device prefix
authorJoao Martins <joao.m.martins@oracle.com>
Wed, 3 Feb 2016 21:40:37 +0000 (21:40 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 4 Feb 2016 12:47:42 +0000 (12:47 +0000)
Use the newly added virCapabilitiesSetNetPrefix to set
the network prefix for the driver. This in return will
be use by NetDefFormat() and NetDefParseXML() routines
to free any interface name that start with the registered
prefix.

Acked-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
src/libxl/libxl_conf.c
src/libxl/libxl_conf.h

index 6320421fe9e3bddd153d1ed1f88473c9fa4213bf..d7fb533902e3b3dc8efea6afc4c5bec99a499f43 100644 (file)
@@ -183,6 +183,9 @@ libxlCapsInitHost(libxl_ctx *ctx, virCapsPtr caps)
         virCapabilitiesAddHostFeature(caps, "pae") < 0)
         return -1;
 
+    if (virCapabilitiesSetNetPrefix(caps, LIBXL_GENERATED_PREFIX_XEN) < 0)
+        return -1;
+
     return 0;
 }
 
index 7c68b2bcedf59ff49056e15ae05d92898fc09441..6ad9ad34c71ffd180a72b1e356db45849bef8beb 100644 (file)
 # define LIBXL_MIGRATION_PORT_MIN  49152
 # define LIBXL_MIGRATION_PORT_MAX  49216
 
+/* Used for prefix of ifname of any network name generated dynamically
+ * by libvirt for Xen, and cannot be used for a persistent network name.  */
+# define LIBXL_GENERATED_PREFIX_XEN "vif"
+
 # define LIBXL_CONFIG_BASE_DIR SYSCONFDIR "/libvirt"
 # define LIBXL_CONFIG_DIR SYSCONFDIR "/libvirt/libxl"
 # define LIBXL_AUTOSTART_DIR LIBXL_CONFIG_DIR "/autostart"