]> xenbits.xensource.com Git - libvirt.git/commitdiff
testutilsqemuschema: Rename and document 'testQEMUSchemaValidateDeprecated'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 24 Sep 2024 13:36:12 +0000 (15:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 1 Oct 2024 10:53:48 +0000 (12:53 +0200)
Upcoming patch will add more features we care to check. Rename the
function to 'testQEMUSchemaValidateFeatures'.

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

index f7b2e122bd2e6913561ded78f1728d96b70cca79..bb3d6b3141f02922cd266825e9f94722780a7ba7 100644 (file)
@@ -29,8 +29,12 @@ struct testQEMUSchemaValidateCtxt {
 };
 
 
+/**
+ * Validate that the schema member doesn't have some significant features:
+ * - 'deprecated' - schema member is deprecated
+ */
 static int
-testQEMUSchemaValidateDeprecated(virJSONValue *root,
+testQEMUSchemaValidateFeatures(virJSONValue *root,
                                  const char *name,
                                  struct testQEMUSchemaValidateCtxt *ctxt)
 {
@@ -187,8 +191,8 @@ testQEMUSchemaValidateObjectMember(const char *key,
         return -1;
     }
 
-    /* validate that the member is not deprecated */
-    if ((rc = testQEMUSchemaValidateDeprecated(keymember, key, data->ctxt)) < 0)
+    /* validate that the member doesn't have some of the significant features */
+    if ((rc = testQEMUSchemaValidateFeatures(keymember, key, data->ctxt)) < 0)
         return rc;
 
     /* lookup schema entry for keytype */
@@ -387,8 +391,8 @@ testQEMUSchemaValidateEnum(virJSONValue *obj,
             if (STREQ_NULLABLE(objstr, virJSONValueObjectGetString(member, "name"))) {
                 int rc;
 
-                /* the new 'members' array allows us to check deprecations */
-                if ((rc = testQEMUSchemaValidateDeprecated(member, objstr, ctxt)) < 0)
+                /* the new 'members' array allows us to check features */
+                if ((rc = testQEMUSchemaValidateFeatures(member, objstr, ctxt)) < 0)
                     return rc;
 
                 virBufferAsprintf(ctxt->debug, "'%s' OK", NULLSTR(objstr));
@@ -526,7 +530,7 @@ testQEMUSchemaValidateRecurse(virJSONValue *obj,
     const char *t = virJSONValueObjectGetString(root, "meta-type");
     int rc;
 
-    if ((rc = testQEMUSchemaValidateDeprecated(root, n, ctxt)) < 0)
+    if ((rc = testQEMUSchemaValidateFeatures(root, n, ctxt)) < 0)
         return rc;
 
     if (STREQ_NULLABLE(t, "builtin")) {
@@ -626,7 +630,7 @@ testQEMUSchemaValidateCommand(const char *command,
         return -1;
     }
 
-    if ((rc = testQEMUSchemaValidateDeprecated(schemarootcommand, command, &ctxt)) < 0)
+    if ((rc = testQEMUSchemaValidateFeatures(schemarootcommand, command, &ctxt)) < 0)
         return rc;
 
     if (!arguments)