[PATCH 6/8] qemu: qapi: Add support for command features

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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;
-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux