]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorTestProcessCommandDefaultValidate: Partially validate 'device_add'
authorPeter Krempa <pkrempa@redhat.com>
Fri, 15 Oct 2021 10:18:00 +0000 (12:18 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 18 Oct 2021 12:00:58 +0000 (14:00 +0200)
Use the 'allowIncomplete' argument of testQEMUSchemaValidateCommand to
validate at least properties which are already described by the schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemumonitortestutils.c

index f5eb77d190465ebb3c5ab9ba7471d7c668c21503..35a1bce07142c321d7d3d6b682dac0e122c7e121 100644 (file)
@@ -524,6 +524,7 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTest *test,
                                              virJSONValue *args)
 {
     g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
+    bool allowIncomplete = false;
 
     if (!test->qapischema)
         return 0;
@@ -535,14 +536,14 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTest *test,
         return -1;
     }
 
-    /* 'device_add' needs to be skipped as it does not have fully defined schema */
+    /* The schema of 'device_add' is incomplete so we relax the validator */
     if (STREQ(cmdname, "device_add"))
-        return 0;
+        allowIncomplete = true;
 
     if (testQEMUSchemaValidateCommand(cmdname, args, test->qapischema,
                                       test->skipValidationDeprecated,
                                       test->skipValidationRemoved,
-                                      false,
+                                      allowIncomplete,
                                       &debug) < 0) {
         if (virTestGetDebug() == 2) {
             g_autofree char *argstr = NULL;