From d0106d5828dec0814fbf4b3237bb62d535465117 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 20 Feb 2015 04:22:06 +0100 Subject: [PATCH] libxl: support backend domain setting for disk and net devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implement handling of parameter introduced in previous patch. Works on Xen >= 4.3, because only there libxl supports setting backend domain by name. Specifying backend domain by ID or UUID is currently not supported. Signed-off-by: Marek Marczykowski-Górecki --- src/libxl/libxl_conf.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index e092b11df5..2321660281 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -975,6 +975,18 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) return -1; } + if (l_disk->domain_name) { +#ifdef LIBXL_HAVE_DEVICE_BACKEND_DOMNAME + if (VIR_STRDUP(x_disk->backend_domname, l_disk->domain_name) < 0) + return -1; +#else + virReportError(VIR_ERR_XML_DETAIL, "%s", + _("this version of libxenlight does not " + "support backend domain name")); + return -1; +#endif + } + return 0; } @@ -1113,6 +1125,18 @@ libxlMakeNic(virDomainDefPtr def, return -1; } + if (l_nic->domain_name) { +#ifdef LIBXL_HAVE_DEVICE_BACKEND_DOMNAME + if (VIR_STRDUP(x_nic->backend_domname, l_nic->domain_name) < 0) + return -1; +#else + virReportError(VIR_ERR_XML_DETAIL, "%s", + _("this version of libxenlight does not " + "support backend domain name")); + return -1; +#endif + } + return 0; }