mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
57cd22bc54
commit
3283950057
@ -76,7 +76,7 @@ virQEMUQAPISchemaTraverse(const char *baseName,
|
||||
virJSONValuePtr base;
|
||||
const char *metatype;
|
||||
|
||||
do {
|
||||
while (1) {
|
||||
if (!(base = virHashLookup(schema, baseName)))
|
||||
return NULL;
|
||||
|
||||
@ -114,7 +114,7 @@ virQEMUQAPISchemaTraverse(const char *baseName,
|
||||
}
|
||||
|
||||
query++;
|
||||
} while (*query);
|
||||
}
|
||||
|
||||
return base;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user