[libvirt] [PATCHv1.5 15/27] conf: Export disk source formatter and parser

Michal Privoznik mprivozn at redhat.com
Wed Nov 27 11:15:34 UTC 2013


On 26.11.2013 17:48, Peter Krempa wrote:
> This code will be reused in the snapshot disk definition parser.
> ---
>  src/conf/domain_conf.c |  4 ++--
>  src/conf/domain_conf.h | 20 ++++++++++++++++++++
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 8f45f2e..0561d9d 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -4737,7 +4737,7 @@ cleanup:
>  }
> 
> 
> -static int
> +int
>  virDomainDiskSourceDefParse(xmlNodePtr node,
>                              int type,
>                              char **source,
> @@ -14377,7 +14377,7 @@ virDomainDiskSourceDefFormatSeclabel(virBufferPtr buf,
>      }
>  }
> 
> -static int
> +int
>  virDomainDiskSourceDefFormatInternal(virBufferPtr buf,
>                                       int type,
>                                       const char *src,
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index a5ef2ca..e9800a5 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -2345,6 +2345,18 @@ int virDomainDefFormatInternal(virDomainDefPtr def,
>                                 unsigned int flags,
>                                 virBufferPtr buf);
> 
> +int virDomainDiskSourceDefFormatInternal(virBufferPtr buf,

It seems rather uncommon to export Internal(). But let's see if you need
this or the virDomainDiskSourceDefFormat() wrapper (if you'd need the
wrapper you hadn't undergo the torture of splitting out the Internal(),
right?)

Okay, it's used in the next patch. I can live with Internal() exported.

> +                                         int type,
> +                                         const char *src,
> +                                         int policy,
> +                                         int protocol,
> +                                         size_t nhosts,
> +                                         virDomainDiskHostDefPtr hosts,
> +                                         size_t nseclabels,
> +                                         virSecurityDeviceLabelDefPtr *seclabels,
> +                                         virDomainDiskSourcePoolDefPtr srcpool,
> +                                         unsigned int flags);
> +
>  int virDomainDefCompatibleDevice(virDomainDefPtr def,
>                                   virDomainDeviceDefPtr dev);
> 
> @@ -2379,6 +2391,14 @@ virDomainDiskDefPtr
>  virDomainDiskRemove(virDomainDefPtr def, size_t i);
>  virDomainDiskDefPtr
>  virDomainDiskRemoveByName(virDomainDefPtr def, const char *name);
> +int virDomainDiskSourceDefParse(xmlNodePtr node,
> +                                int type,
> +                                char **source,
> +                                int *proto,
> +                                size_t *nhosts,
> +                                virDomainDiskHostDefPtr *hosts,
> +                                virDomainDiskSourcePoolDefPtr *srcpool);
> +
>  bool virDomainHasDiskMirror(virDomainObjPtr vm);
> 
>  int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net);
> 

ACK

Michal




More information about the libvir-list mailing list