]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQEMUSchemaValidateEnum: Validate deprecated members
authorPeter Krempa <pkrempa@redhat.com>
Fri, 17 Sep 2021 14:38:11 +0000 (16:38 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 1 Nov 2021 16:37:15 +0000 (17:37 +0100)
Starting from QEMU-6.2 enum members can be deprecated. Add support to
the validator.

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

index aaa0fdaea96f3fcb495557ac0ad9be5c6b68a7df..4a0fb8d944fe3e5c6e9ed5a211c61669dfc15cf9 100644 (file)
@@ -381,6 +381,12 @@ testQEMUSchemaValidateEnum(virJSONValue *obj,
             virJSONValue *member = virJSONValueArrayGet(members, i);
 
             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)
+                    return rc;
+
                 virBufferAsprintf(ctxt->debug, "'%s' OK", NULLSTR(objstr));
                 return 0;
             }