提交 32839500 编写于 作者: P Peter Krempa

qemu: qapi: Return correct entry in virQEMUQAPISchemaTraverse

virQEMUQAPISchemaTraverse would return previous-to-last queried item on
a query. It would not be a problem if checking if the given path exists
since error reporting works properly but if the caller is interested in
the result, it would be wrong.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 57cd22bc
...@@ -76,7 +76,7 @@ virQEMUQAPISchemaTraverse(const char *baseName, ...@@ -76,7 +76,7 @@ virQEMUQAPISchemaTraverse(const char *baseName,
virJSONValuePtr base; virJSONValuePtr base;
const char *metatype; const char *metatype;
do { while (1) {
if (!(base = virHashLookup(schema, baseName))) if (!(base = virHashLookup(schema, baseName)))
return NULL; return NULL;
...@@ -114,7 +114,7 @@ virQEMUQAPISchemaTraverse(const char *baseName, ...@@ -114,7 +114,7 @@ virQEMUQAPISchemaTraverse(const char *baseName,
} }
query++; query++;
} while (*query); }
return base; return base;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册