Re: [PATCH v4 1/3] network_conf: Expose virNetworkDefFormatInternal

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

 



On 02/12/2014 07:07 PM, Michal Privoznik wrote:
> In the next patch I'm going to need the network format function that
> takes virBuffer as argument. However, slightly change of name is more
> appropriate then: virNetworkDefFormatBuf to match the rest of functions
> that format an object to buffer.
>
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/conf/network_conf.c  | 12 ++++++------
>  src/conf/network_conf.h  |  3 +++
>  src/libvirt_private.syms |  1 +
>  3 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
> index dd3fa19..8b6236d 100644
> --- a/src/conf/network_conf.c
> +++ b/src/conf/network_conf.c
> @@ -2593,10 +2593,10 @@ cleanup:
>      return ret;
>  }
>  
> -static int
> -virNetworkDefFormatInternal(virBufferPtr buf,
> -                            const virNetworkDef *def,
> -                            unsigned int flags)
> +int
> +virNetworkDefFormatBuf(virBufferPtr buf,
> +                       const virNetworkDef *def,
> +                       unsigned int flags)
>  {
>      const unsigned char *uuid;
>      char uuidstr[VIR_UUID_STRING_BUFLEN];
> @@ -2763,7 +2763,7 @@ virNetworkDefFormat(const virNetworkDef *def,
>  {
>      virBuffer buf = VIR_BUFFER_INITIALIZER;
>  
> -    if (virNetworkDefFormatInternal(&buf, def, flags) < 0)
> +    if (virNetworkDefFormatBuf(&buf, def, flags) < 0)
>          goto error;
>  
>      if (virBufferError(&buf))
> @@ -2794,7 +2794,7 @@ virNetworkObjFormat(virNetworkObjPtr net,
>      VIR_FREE(class_id);
>  
>      virBufferAdjustIndent(&buf, 2);
> -    if (virNetworkDefFormatInternal(&buf, net->def, flags) < 0)
> +    if (virNetworkDefFormatBuf(&buf, net->def, flags) < 0)
>          goto error;
>  
>      virBufferAdjustIndent(&buf, -2);
> diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
> index b84762a..47124ce 100644
> --- a/src/conf/network_conf.h
> +++ b/src/conf/network_conf.h
> @@ -338,6 +338,9 @@ virNetworkDefPtr virNetworkDefParseFile(const char *filename);
>  virNetworkDefPtr virNetworkDefParseNode(xmlDocPtr xml,
>                                          xmlNodePtr root);
>  char *virNetworkDefFormat(const virNetworkDef *def, unsigned int flags);
> +int virNetworkDefFormatBuf(virBufferPtr buf,
> +                           const virNetworkDef *def,
> +                           unsigned int flags);
>  
>  static inline const char *
>  virNetworkDefForwardIf(const virNetworkDef *def, size_t n)
> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> index 2c9536a..b554f11 100644
> --- a/src/libvirt_private.syms
> +++ b/src/libvirt_private.syms
> @@ -504,6 +504,7 @@ virNetworkConfigChangeSetup;
>  virNetworkConfigFile;
>  virNetworkDefCopy;
>  virNetworkDefFormat;
> +virNetworkDefFormatBuf;
>  virNetworkDefFree;
>  virNetworkDefGetIpByIndex;
>  virNetworkDefParseFile;

ACK.

--
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]