]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemumonitorjsontest: load schema based on specified arch
authorCollin Walling <walling@linux.ibm.com>
Thu, 20 Feb 2020 22:01:46 +0000 (17:01 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 21 Feb 2020 09:50:10 +0000 (10:50 +0100)
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: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemublocktest.c
tests/qemuhotplugtest.c
tests/qemumonitorjsontest.c
tests/testutilsqemuschema.c
tests/testutilsqemuschema.h

index 5a564b71df276cbe10f038115d81228e9bc91fba..7b7948d4c69e804158d221e8e1b7cb1b35a60f4b 100644 (file)
@@ -981,7 +981,7 @@ mymain(void)
 
 #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;
         goto cleanup;
     }
index 6a3e61c54bdd7ca096e24ff13e9fb83e6f15134f..9dd42664cd7efa29c22775e9f3e390bfb9a95539 100644 (file)
@@ -620,7 +620,7 @@ mymain(void)
     if (!(driver.domainEventState = virObjectEventStateNew()))
         return EXIT_FAILURE;
 
-    if (!(qmpschema = testQEMUSchemaLoad())) {
+    if (!(qmpschema = testQEMUSchemaLoad("x86_64"))) {
         VIR_TEST_VERBOSE("failed to load qapi schema\n");
         return EXIT_FAILURE;
     }
index 24e0ce15ed8176dae799eff3f27ea2e4afb29290..cd7fa1f41d31f174824bdcec6e6ca764d3eae3f7 100644 (file)
@@ -2995,7 +2995,7 @@ mymain(void)
 
     virEventRegisterDefaultImpl();
 
-    if (!(qapiData.schema = testQEMUSchemaLoad())) {
+    if (!(qapiData.schema = testQEMUSchemaLoad("x86_64"))) {
         VIR_TEST_VERBOSE("failed to load qapi schema");
         ret = -1;
         goto cleanup;
@@ -3232,7 +3232,7 @@ mymain(void)
     DO_TEST_QAPI_VALIDATE("alternate 2", "blockdev-add/arg-type", false,
                           "{\"driver\":\"qcow2\",\"file\": 1234}");
 
-    if (!(metaschema = testQEMUSchemaGetLatest()) ||
+    if (!(metaschema = testQEMUSchemaGetLatest("x86_64")) ||
         !(metaschemastr = virJSONValueToString(metaschema, false))) {
         VIR_TEST_VERBOSE("failed to load latest qapi schema");
         ret = -1;
index 9a1b1fea07d4eccc6537525086151d90f3f47ab1..7b82ff27b27efbbeaf46c0c88f44cac54095ce4f 100644 (file)
@@ -524,7 +524,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
  * replies file used for qemucapabilitiestest for the x86_64 architecture.
  */
 virJSONValuePtr
-testQEMUSchemaGetLatest(void)
+testQEMUSchemaGetLatest(const char* arch)
 {
     char *capsLatestFile = NULL;
     char *capsLatest = NULL;
@@ -533,7 +533,7 @@ testQEMUSchemaGetLatest(void)
     virJSONValuePtr reply = NULL;
     virJSONValuePtr schema = NULL;
 
-    if (!(capsLatestFile = testQemuGetLatestCapsForArch("x86_64", "replies"))) {
+    if (!(capsLatestFile = testQemuGetLatestCapsForArch(arch, "replies"))) {
         VIR_TEST_VERBOSE("failed to find latest caps replies");
         return NULL;
     }
@@ -575,11 +575,11 @@ testQEMUSchemaGetLatest(void)
 
 
 virHashTablePtr
-testQEMUSchemaLoad(void)
+testQEMUSchemaLoad(const char* arch)
 {
     virJSONValuePtr schema;
 
-    if (!(schema = testQEMUSchemaGetLatest()))
+    if (!(schema = testQEMUSchemaGetLatest(arch)))
         return NULL;
 
     return virQEMUQAPISchemaConvert(schema);
index de9da7cb975f57ff4a82b93eda1e42c00f881fdd..84ee9a9670db5ff1806b57cf74d4955163ebf926 100644 (file)
@@ -29,7 +29,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
                        virBufferPtr debug);
 
 virJSONValuePtr
-testQEMUSchemaGetLatest(void);
+testQEMUSchemaGetLatest(const char* arch);
 
 virHashTablePtr
-testQEMUSchemaLoad(void);
+testQEMUSchemaLoad(const char* arch);