mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
testCompareXMLToArgvValidateSchema: Base -netdev validation on JSON
Base the validation on presence of JSON as we do with other validated commands. This will prepare the code for a refactor so that it's the same for all validated commands. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c6a9285925
commit
36253a48b4
@ -503,7 +503,6 @@ testCompareXMLToArgvValidateSchema(virQEMUDriver *drv,
|
|||||||
GHashTable *schema = NULL;
|
GHashTable *schema = NULL;
|
||||||
g_autoptr(virCommand) cmd = NULL;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
unsigned int parseFlags = info->parseFlags;
|
unsigned int parseFlags = info->parseFlags;
|
||||||
bool netdevQAPIfied = false;
|
|
||||||
|
|
||||||
/* comment out with line comment to enable schema checking for non _CAPS tests
|
/* comment out with line comment to enable schema checking for non _CAPS tests
|
||||||
if (!info->schemafile)
|
if (!info->schemafile)
|
||||||
@ -546,8 +545,6 @@ testCompareXMLToArgvValidateSchema(virQEMUDriver *drv,
|
|||||||
if (virCommandGetArgList(cmd, &args, &nargs) < 0)
|
if (virCommandGetArgList(cmd, &args, &nargs) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
netdevQAPIfied = !virQEMUQAPISchemaPathExists("netdev_add/arg-type/type/!string", schema);
|
|
||||||
|
|
||||||
for (i = 0; i < nargs; i++) {
|
for (i = 0; i < nargs; i++) {
|
||||||
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
|
||||||
g_autoptr(virJSONValue) jsonargs = NULL;
|
g_autoptr(virJSONValue) jsonargs = NULL;
|
||||||
@ -565,7 +562,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriver *drv,
|
|||||||
|
|
||||||
i++;
|
i++;
|
||||||
} else if (STREQ(args[i], "-netdev")) {
|
} else if (STREQ(args[i], "-netdev")) {
|
||||||
if (!netdevQAPIfied) {
|
if (*args[i + 1] != '{') {
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user