From e0300f92fc07d3ed15662cc7158ae20e1d796834 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 17 Sep 2019 17:08:56 +0200 Subject: [PATCH] qemu: qapi: Add support for command features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The top level commands now can have 'feature' flags for fixes so add support for querying those as well. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrangé --- 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); + } if (!(querytype = virJSONValueObjectGetString(cur, query))) return 0; -- GitLab