qemuMonitorTestProcessCommandDefaultValidate: Partially validate 'device_add'

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>
This commit is contained in:
Peter Krempa 2021-10-15 12:18:00 +02:00
parent b17fd211e2
commit 697e796981

View File

@ -524,6 +524,7 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTest *test,
virJSONValue *args) virJSONValue *args)
{ {
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
bool allowIncomplete = false;
if (!test->qapischema) if (!test->qapischema)
return 0; return 0;
@ -535,14 +536,14 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTest *test,
return -1; 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")) if (STREQ(cmdname, "device_add"))
return 0; allowIncomplete = true;
if (testQEMUSchemaValidateCommand(cmdname, args, test->qapischema, if (testQEMUSchemaValidateCommand(cmdname, args, test->qapischema,
test->skipValidationDeprecated, test->skipValidationDeprecated,
test->skipValidationRemoved, test->skipValidationRemoved,
false, allowIncomplete,
&debug) < 0) { &debug) < 0) {
if (virTestGetDebug() == 2) { if (virTestGetDebug() == 2) {
g_autofree char *argstr = NULL; g_autofree char *argstr = NULL;