提交 6523a7ea 编写于 作者: C Collin Walling 提交者: Michal Privoznik

qemumonitorjsontest: load schema based on specified arch

There are some architectures that support capabilities that others
do not (e.g. s390x supports cpu comparison and baseline via QEMU).

Let's make testQEMUSchemaLoad accept a string to specify the schema
to load based on the specified arch.
Signed-off-by: NCollin Walling <walling@linux.ibm.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 c312c899
...@@ -981,7 +981,7 @@ mymain(void) ...@@ -981,7 +981,7 @@ mymain(void)
#define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false) #define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false)
if (!(diskxmljsondata.schema = testQEMUSchemaLoad())) { if (!(diskxmljsondata.schema = testQEMUSchemaLoad("x86_64"))) {
ret = -1; ret = -1;
goto cleanup; goto cleanup;
} }
......
...@@ -620,7 +620,7 @@ mymain(void) ...@@ -620,7 +620,7 @@ mymain(void)
if (!(driver.domainEventState = virObjectEventStateNew())) if (!(driver.domainEventState = virObjectEventStateNew()))
return EXIT_FAILURE; return EXIT_FAILURE;
if (!(qmpschema = testQEMUSchemaLoad())) { if (!(qmpschema = testQEMUSchemaLoad("x86_64"))) {
VIR_TEST_VERBOSE("failed to load qapi schema\n"); VIR_TEST_VERBOSE("failed to load qapi schema\n");
return EXIT_FAILURE; return EXIT_FAILURE;
} }
......
...@@ -2995,7 +2995,7 @@ mymain(void) ...@@ -2995,7 +2995,7 @@ mymain(void)
virEventRegisterDefaultImpl(); virEventRegisterDefaultImpl();
if (!(qapiData.schema = testQEMUSchemaLoad())) { if (!(qapiData.schema = testQEMUSchemaLoad("x86_64"))) {
VIR_TEST_VERBOSE("failed to load qapi schema"); VIR_TEST_VERBOSE("failed to load qapi schema");
ret = -1; ret = -1;
goto cleanup; goto cleanup;
...@@ -3232,7 +3232,7 @@ mymain(void) ...@@ -3232,7 +3232,7 @@ mymain(void)
DO_TEST_QAPI_VALIDATE("alternate 2", "blockdev-add/arg-type", false, DO_TEST_QAPI_VALIDATE("alternate 2", "blockdev-add/arg-type", false,
"{\"driver\":\"qcow2\",\"file\": 1234}"); "{\"driver\":\"qcow2\",\"file\": 1234}");
if (!(metaschema = testQEMUSchemaGetLatest()) || if (!(metaschema = testQEMUSchemaGetLatest("x86_64")) ||
!(metaschemastr = virJSONValueToString(metaschema, false))) { !(metaschemastr = virJSONValueToString(metaschema, false))) {
VIR_TEST_VERBOSE("failed to load latest qapi schema"); VIR_TEST_VERBOSE("failed to load latest qapi schema");
ret = -1; ret = -1;
......
...@@ -524,7 +524,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj, ...@@ -524,7 +524,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
* replies file used for qemucapabilitiestest for the x86_64 architecture. * replies file used for qemucapabilitiestest for the x86_64 architecture.
*/ */
virJSONValuePtr virJSONValuePtr
testQEMUSchemaGetLatest(void) testQEMUSchemaGetLatest(const char* arch)
{ {
char *capsLatestFile = NULL; char *capsLatestFile = NULL;
char *capsLatest = NULL; char *capsLatest = NULL;
...@@ -533,7 +533,7 @@ testQEMUSchemaGetLatest(void) ...@@ -533,7 +533,7 @@ testQEMUSchemaGetLatest(void)
virJSONValuePtr reply = NULL; virJSONValuePtr reply = NULL;
virJSONValuePtr schema = NULL; virJSONValuePtr schema = NULL;
if (!(capsLatestFile = testQemuGetLatestCapsForArch("x86_64", "replies"))) { if (!(capsLatestFile = testQemuGetLatestCapsForArch(arch, "replies"))) {
VIR_TEST_VERBOSE("failed to find latest caps replies"); VIR_TEST_VERBOSE("failed to find latest caps replies");
return NULL; return NULL;
} }
...@@ -575,11 +575,11 @@ testQEMUSchemaGetLatest(void) ...@@ -575,11 +575,11 @@ testQEMUSchemaGetLatest(void)
virHashTablePtr virHashTablePtr
testQEMUSchemaLoad(void) testQEMUSchemaLoad(const char* arch)
{ {
virJSONValuePtr schema; virJSONValuePtr schema;
if (!(schema = testQEMUSchemaGetLatest())) if (!(schema = testQEMUSchemaGetLatest(arch)))
return NULL; return NULL;
return virQEMUQAPISchemaConvert(schema); return virQEMUQAPISchemaConvert(schema);
......
...@@ -29,7 +29,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj, ...@@ -29,7 +29,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
virBufferPtr debug); virBufferPtr debug);
virJSONValuePtr virJSONValuePtr
testQEMUSchemaGetLatest(void); testQEMUSchemaGetLatest(const char* arch);
virHashTablePtr virHashTablePtr
testQEMUSchemaLoad(void); testQEMUSchemaLoad(const char* arch);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册