
On Wed, Jun 07, 2017 at 10:37:27AM +0200, Jiri Denemark wrote:
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> ---
Notes: Version 2: - no need to distinguish 0 vs 1 return codes - better documentation
src/conf/cpu_conf.c | 109 +++++++++++++++++++++++++++---------------------- src/conf/cpu_conf.h | 9 ++-- src/conf/domain_conf.c | 12 +----- src/cpu/cpu.c | 5 +-- tests/cputest.c | 5 +-- 5 files changed, 72 insertions(+), 68 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index ffb2e83d6..ae9f52c8d 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -245,12 +245,25 @@ 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 "."). + * + * Missing <cpu> element in the XML document is not considered an error unless + * @xpath is NULL in which case the function expects it was provided with a + * valid <cpu> element already. In other words, the function returns success + * and sets @cpu to NULL if @xpath is not NULL and the node pointed to by + * @xpath is not found. + * + * Returns 0 on success, -1 on error.
Extra space or missing colon. Reviewed-by: Pavel Hrdina <phrdina@redhat.com>