[libvirt] [PATCHv4 03/10] libxl: support backend domain setting for disk and net devices
Jim Fehlig
jfehlig at suse.com
Fri Feb 20 21:59:27 UTC 2015
Marek Marczykowski-Górecki wrote:
> From: Marek Marczykowski <marmarek at invisiblethingslab.com>
>
> 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, not XID.
>
> Signed-off-by: Marek Marczykowski-Górecki <marmarek at invisiblethingslab.com>
> ---
> Changes in v2:
> - rebase on 1.0.6+
> - fix indentation
> - make libxl_name_to_domid switch more defensive
>
> Changes in v3:
> - rebase on 1.2.12+
> - leave name->XID resolution to libxl itself, which greatly simplify
> the code (but requires Xen at least 4.3)
>
> Changes in v4:
> - change back to def->domain_name in disk handling code
>
> 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 0555b91..5cf3d8f 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -971,6 +971,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->src->domain_name) < 0)
>
l_disk->domain_name.
> + return -1;
> +#else
> + virReportError(VIR_ERR_XML_DETAIL, "%s",
> + _("this version of libxenlight does not "
> + "support backend domain name"));
> + return -1;
> +#endif
> + }
> +
> return 0;
> }
>
> @@ -1098,6 +1110,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;
> }
>
ACK. I've added the above fix and pushed 2 and 3.
BTW, similar to 6/10, can you add parsing/formating of backenddomain in
src/xenconfig?
Regards,
Jim
More information about the libvir-list
mailing list