1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

libxl: set net device prefix

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>
This commit is contained in:
Joao Martins 2016-02-03 21:40:37 +00:00 committed by Daniel P. Berrange
parent cd57b7c742
commit a040ba9ed4
2 changed files with 7 additions and 0 deletions

View 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;
}

View File

@ -47,6 +47,10 @@
# 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"