testQEMUSchemaValidateEnum: Validate deprecated members

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>
This commit is contained in:
Peter Krempa 2021-09-17 16:38:11 +02:00
parent 43e2c6544e
commit cc54647fb0

View 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;
}