g_autoptr(GHashTable) schema = NULL;
g_autoptr(virCommand) cmd = NULL;
unsigned int parseFlags = info->parseFlags;
+ bool netdevQAPIfied = false;
if (info->schemafile)
schema = testQEMUSchemaLoad(info->schemafile);
if (virCommandGetArgList(cmd, &args, &nargs) < 0)
return -1;
+ netdevQAPIfied = !virQEMUQAPISchemaPathExists("netdev_add/arg-type/type/!string", schema);
+
for (i = 0; i < nargs; i++) {
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
g_autoptr(virJSONValue) jsonargs = NULL;
i++;
} else if (STREQ(args[i], "-netdev")) {
+ if (!netdevQAPIfied) {
+ i++;
+ continue;
+ }
+
if (!(jsonargs = virJSONValueFromString(args[i + 1])))
return -1;
- /* skip the validation for pre-QAPIfication cases */
- if (virQEMUQAPISchemaPathExists("netdev_add/arg-type/type/!string", schema))
- continue;
-
if (testQEMUSchemaValidateCommand("netdev_add", jsonargs,
schema, false, false, &debug) < 0) {
VIR_TEST_VERBOSE("failed to validate -netdev '%s' against QAPI schema: %s",