Re: [PATCH 4/7] conf: Added NFS XML format/parse methods

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

 



On Tue, Dec 29, 2020 at 15:21:26 -0600, Ryan Gahagan wrote:
> Signed-off-by: Ryan Gahagan <rgahagan@xxxxxxxxxxxxx>
> ---
>  src/conf/domain_conf.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index b301ac0a08..565ca680c9 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c

This patch can be merged into the previous one if you want.

> @@ -23805,6 +23825,19 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf,
>          virBufferAddLit(childBuf, "/>\n");
>      }
>  
> +    if (src->protocol == VIR_STORAGE_NET_PROTOCOL_NFS &&
> +        (src->nfs_user || src->nfs_group)) {
> +        virBufferAddLit(childBuf, "<nfs");
> +
> +        if (src->nfs_user)

virBufferEscapeString has a special corner-case that it doesn't format
anything if the third argument is NULL, so the explicit check is not
necessary.

> +            virBufferEscapeString(childBuf, " user='%s'", src->nfs_user);
> +        if (src->nfs_group)
> +            virBufferEscapeString(childBuf, " group='%s'", src->nfs_group);
> +
> +        virBufferAddLit(childBuf, "/>\n");
> +    }

With the code simplified:

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>




[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