]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemublocktest: testBackingXMLjsonXML: Drop 'legacy' mode
authorPeter Krempa <pkrempa@redhat.com>
Wed, 18 Oct 2023 14:55:13 +0000 (16:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 27 Oct 2023 13:04:20 +0000 (15:04 +0200)
Legacy mode used to be needed for use with -drive, which was almost
completely deleted. We now have qemuxml2argvtest test cases checking a
few cases and the rest uses the modern mode only. Thus we don't need to
test the legacy mode any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemublocktest.c

index 161fd84871ef1d4a5cdbf177d9f16e9237b88e9f..b8db1a2570d8a78eb7f6b52f37d52659b3c7ac17 100644 (file)
@@ -61,8 +61,6 @@ testBackingXMLjsonXML(const void *args)
     g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
     unsigned int backendpropsflags = QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY;
 
-    if (data->legacy)
-        backendpropsflags |= QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY;
 
     xmlsrc = virStorageSourceNew();
     xmlsrc->type = data->type;
@@ -81,17 +79,15 @@ testBackingXMLjsonXML(const void *args)
         return -1;
     }
 
-    if (!data->legacy) {
-        if (testQEMUSchemaValidate(backendprops, data->schemaroot,
-                                   data->schema, false, &debug) < 0) {
-            g_autofree char *debugmsg = virBufferContentAndReset(&debug);
-            g_autofree char *debugprops = virJSONValueToString(backendprops, true);
+    if (testQEMUSchemaValidate(backendprops, data->schemaroot,
+                               data->schema, false, &debug) < 0) {
+        g_autofree char *debugmsg = virBufferContentAndReset(&debug);
+        g_autofree char *debugprops = virJSONValueToString(backendprops, true);
 
-            VIR_TEST_VERBOSE("json does not conform to QAPI schema");
-            VIR_TEST_DEBUG("json:\n%s\ndoes not match schema. Debug output:\n %s",
-                           debugprops, NULLSTR(debugmsg));
-            return -1;
-        }
+        VIR_TEST_VERBOSE("json does not conform to QAPI schema");
+        VIR_TEST_DEBUG("json:\n%s\ndoes not match schema. Debug output:\n %s",
+                       debugprops, NULLSTR(debugmsg));
+        return -1;
     }
 
     if (virJSONValueObjectAdd(&wrapper, "a:file", &backendprops, NULL) < 0)
@@ -1012,11 +1008,6 @@ mymain(void)
     do { \
         xmljsonxmldata.type = tpe; \
         xmljsonxmldata.xml = xmlstr; \
-        xmljsonxmldata.legacy = true; \
-        if (virTestRun(virTestCounterNext(), testBackingXMLjsonXML, \
-                       &xmljsonxmldata) < 0) \
-            ret = -1; \
-        xmljsonxmldata.legacy = false; \
         if (virTestRun(virTestCounterNext(), testBackingXMLjsonXML, \
                        &xmljsonxmldata) < 0) \
             ret = -1; \