Re: [PATCH 02/15] conf: Refactor virCPUDefParseXML

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

 



On Mon, Jun 05, 2017 at 11:26:50AM +0200, Jiri Denemark wrote:
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/conf/cpu_conf.c    | 105 +++++++++++++++++++++++++++----------------------
>  src/conf/cpu_conf.h    |   9 +++--
>  src/conf/domain_conf.c |  12 +-----
>  src/cpu/cpu.c          |   5 +--
>  tests/cputest.c        |   5 +--
>  5 files changed, 68 insertions(+), 68 deletions(-)
> 
> diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
> index 79ed5e646..f7f726761 100644
> --- a/src/conf/cpu_conf.c
> +++ b/src/conf/cpu_conf.c
> @@ -245,12 +245,21 @@ virCPUDefCopy(const virCPUDef *cpu)
>  }
>  
>  
> -virCPUDefPtr
> -virCPUDefParseXML(xmlNodePtr node,
> -                  xmlXPathContextPtr ctxt,
> -                  virCPUType type)
> +/*
> + * Parses CPU definition XML from a node pointed to by @xpath. If @xpath is
> + * NULL, the current node of @ctxt is used (i.e., it is a shortcut to ".").
> + *
> + * Returns  0 on success,
> + *          1 when @xpath element cannot be found in @ctxt,
> + *         -1 on error.
> + */

All the paths in the whole series checks only for return value < 0 so
there is no reason to return 1.  Another thing is that if the return
value is 1 the @cpu would be NULL and that isn't documented.  So we can
return only 0|-1 and document that the @cpu can be NULL if @xpath was
provided but not found in ctxt.

Pavel

Attachment: signature.asc
Description: Digital signature

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