]> xenbits.xensource.com Git - libvirt.git/commitdiff
testutilsqemuschema: Support 'unstable' feature in QMP schema validator
authorPeter Krempa <pkrempa@redhat.com>
Tue, 24 Sep 2024 13:27:23 +0000 (15:27 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 1 Oct 2024 10:53:49 +0000 (12:53 +0200)
The 'unstable' feature is present on any schema member which was not yet
finalized in qemu. Use it to refuse such fields/commands in qemu as they
are possibly subject to change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tests/testutilsqemuschema.c

index bb3d6b3141f02922cd266825e9f94722780a7ba7..6ee83c3ba77b826626a9bfcbf5a71b3735c15f9b 100644 (file)
@@ -32,6 +32,7 @@ struct testQEMUSchemaValidateCtxt {
 /**
  * Validate that the schema member doesn't have some significant features:
  * - 'deprecated' - schema member is deprecated
+ * - 'unstable' - schema member is considered unstable
  */
 static int
 testQEMUSchemaValidateFeatures(virJSONValue *root,
@@ -57,6 +58,11 @@ testQEMUSchemaValidateFeatures(virJSONValue *root,
             return -2;
         }
 
+        if (STREQ(curstr, "unstable")) {
+            virBufferAsprintf(ctxt->debug, "ERROR: '%s' is unstable", name);
+            return -1;
+        }
+
         if (STREQ(curstr, "deprecated")) {
             if (ctxt->allowDeprecated) {
                 virBufferAsprintf(ctxt->debug, "WARNING: '%s' is deprecated", name);