On Mon, Nov 18, 2019 at 06:02:06PM +0100, Peter Krempa wrote:
The top level commands now can have 'feature' flags for fixes
so add
support for querying those as well.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_qapi.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c
index 484f274c63..8e66f9f180 100644
--- a/src/qemu/qemu_qapi.c
+++ b/src/qemu/qemu_qapi.c
@@ -216,6 +216,21 @@ virQEMUQAPISchemaTraverseCommand(virJSONValuePtr cur,
{
const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt);
const char *querytype;
+ char modifier = *query;
+
+ if (!c_isalpha(modifier))
+ query++;
+
+ /* exit on modifers for other types */
+ if (modifier == '^' || modifier == '!' || modifier == '+' ||
modifier == '*')
+ return 0;
+
+ if (modifier == '$') {
+ if (virQEMUQAPISchemaTraverseContextHasNextQuery(ctxt))
+ return -3;
+
+ return virQEMUQAPISchemaTraverseHasObjectFeature(query, cur);
+ }
We're silently ignoring any unknown modifier, ok since this is trusted
data and no caller is wrong. For sanity I might still report an error
if there's one we don't expect though.
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|