From 697e796981420bafc7b247fad44928a20272054c Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 15 Oct 2021 12:18:00 +0200 Subject: [PATCH] qemuMonitorTestProcessCommandDefaultValidate: Partially validate 'device_add' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the 'allowIncomplete' argument of testQEMUSchemaValidateCommand to validate at least properties which are already described by the schema. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/qemumonitortestutils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index f5eb77d190..35a1bce071 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -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;