libxl: support backend domain setting for disk and net devices

This implement handling of <backenddomain name=''/>  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 <marmarek@invisiblethingslab.com>
This commit is contained in:
Marek Marczykowski 2015-02-20 04:22:06 +01:00 committed by Jim Fehlig
parent c374353ca0
commit d0106d5828

View File

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