mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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:
parent
c374353ca0
commit
d0106d5828
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user