mirror of https://gitee.com/openkylin/libvirt.git
tests: qemumonitor: Prepare for more test data in testBlockNodeNameDetect
Rename 'json' and related variables to 'nodeNameJson'. Also rename the test files along. This is a preparation for modifying how we detect node names which will also require data from 'query-blockstats'. Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
2b5d5d68ca
commit
f1ce954b32
|
@ -2740,19 +2740,19 @@ static int
|
|||
testBlockNodeNameDetect(const void *opaque)
|
||||
{
|
||||
const struct testBlockNodeNameDetectData *data = opaque;
|
||||
char *jsonFile = NULL;
|
||||
char *jsonStr = NULL;
|
||||
char *namedNodesFile = NULL;
|
||||
char *namedNodesStr = NULL;
|
||||
char *resultFile = NULL;
|
||||
char *actual = NULL;
|
||||
char **nodenames = NULL;
|
||||
char **next;
|
||||
virJSONValuePtr json = NULL;
|
||||
virJSONValuePtr namedNodesJson = NULL;
|
||||
virHashTablePtr nodedata = NULL;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
int ret = -1;
|
||||
|
||||
if (virAsprintf(&jsonFile,
|
||||
"%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.json",
|
||||
if (virAsprintf(&namedNodesFile,
|
||||
"%s/qemumonitorjsondata/qemumonitorjson-nodename-%s-named-nodes.json",
|
||||
abs_srcdir, data->name) < 0 ||
|
||||
virAsprintf(&resultFile,
|
||||
"%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.result",
|
||||
|
@ -2762,13 +2762,13 @@ testBlockNodeNameDetect(const void *opaque)
|
|||
if (!(nodenames = virStringSplit(data->nodenames, ",", 0)))
|
||||
goto cleanup;
|
||||
|
||||
if (virTestLoadFile(jsonFile, &jsonStr) < 0)
|
||||
if (virTestLoadFile(namedNodesFile, &namedNodesStr) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(json = virJSONValueFromString(jsonStr)))
|
||||
if (!(namedNodesJson = virJSONValueFromString(namedNodesStr)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(nodedata = qemuBlockNodeNameGetBackingChain(json)))
|
||||
if (!(nodedata = qemuBlockNodeNameGetBackingChain(namedNodesJson)))
|
||||
goto cleanup;
|
||||
|
||||
for (next = nodenames; *next; next++)
|
||||
|
@ -2787,13 +2787,13 @@ testBlockNodeNameDetect(const void *opaque)
|
|||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(jsonFile);
|
||||
VIR_FREE(namedNodesFile);
|
||||
VIR_FREE(resultFile);
|
||||
VIR_FREE(jsonStr);
|
||||
VIR_FREE(namedNodesStr);
|
||||
VIR_FREE(actual);
|
||||
virHashFree(nodedata);
|
||||
virStringListFree(nodenames);
|
||||
virJSONValueFree(json);
|
||||
virJSONValueFree(namedNodesJson);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue