Re: [PATCH 3/9] Split out virDomainIOMMUDefFormat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 03/23/2017 11:26 AM, Ján Tomko wrote:
> Make adding subelements easier.

No bz reference here

> ---
>  src/conf/domain_conf.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index ffc6a68..1245fdd 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -23842,6 +23842,15 @@ virDomainDefIothreadShouldFormat(virDomainDefPtr def)
>  }
>  
>  
> +static void
> +virDomainIOMMUDefFormat(virBufferPtr buf,
> +                        virDomainIOMMUDefPtr iommu)

Could also use const virDomainIOMMUDef *iommu here I think

ACK regardless,

John

> +{
> +    virBufferAsprintf(buf, "<iommu model='%s'/>\n",
> +                      virDomainIOMMUModelTypeToString(iommu->model));
> +}
> +
> +
>  /* This internal version appends to an existing buffer
>   * (possibly with auto-indent), rather than flattening
>   * to string.
> @@ -24595,10 +24604,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
>              goto error;
>      }
>  
> -    if (def->iommu) {
> -        virBufferAsprintf(buf, "<iommu model='%s'/>\n",
> -                          virDomainIOMMUModelTypeToString(def->iommu->model));
> -    }
> +    if (def->iommu)
> +        virDomainIOMMUDefFormat(buf, def->iommu);
>  
>      virBufferAdjustIndent(buf, -2);
>      virBufferAddLit(buf, "</devices>\n");
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux