Blame SOURCES/libvirt-testQemuDiskXMLToPropsValidateFileSrcOnly-Move-together-with-rest-of-xml-json-code.patch

fbe740
From 067d165d1ffd968d07ff54c07ccd3bb529d0c130 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <067d165d1ffd968d07ff54c07ccd3bb529d0c130@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 24 Mar 2020 16:25:59 +0100
fbe740
Subject: [PATCH] testQemuDiskXMLToPropsValidateFileSrcOnly: Move together with
fbe740
 rest of xml->json code
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
The function was misplaced. Group it together with other helper
fbe740
functions for testing disk XML to qemu JSON props conversion.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
(cherry picked from commit fed97cb435092d9de6f3c862ef297e722f0c0263)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804617
fbe740
Message-Id: <8e84dfd63f90b8b0bf10fe72bb3dcf07af9f6e96.1585063415.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 tests/qemublocktest.c | 61 ++++++++++++++++++++++---------------------
fbe740
 1 file changed, 31 insertions(+), 30 deletions(-)
fbe740
fbe740
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
fbe740
index 40aa1e2825..14c80960b1 100644
fbe740
--- a/tests/qemublocktest.c
fbe740
+++ b/tests/qemublocktest.c
fbe740
@@ -387,6 +387,37 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque)
fbe740
 }
fbe740
 
fbe740
 
fbe740
+static int
fbe740
+testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque)
fbe740
+{
fbe740
+    struct testQemuDiskXMLToJSONData *data = (void *) opaque;
fbe740
+    g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
fbe740
+    g_autofree char *jsonpath = NULL;
fbe740
+    g_autofree char *actual = NULL;
fbe740
+    size_t i;
fbe740
+
fbe740
+    if (data->fail)
fbe740
+        return EXIT_AM_SKIP;
fbe740
+
fbe740
+    jsonpath = g_strdup_printf("%s%s-srconly.json", testQemuDiskXMLToJSONPath,
fbe740
+                               data->name);
fbe740
+
fbe740
+    for (i = 0; i < data->npropssrc; i++) {
fbe740
+        g_autofree char *jsonstr = NULL;
fbe740
+
fbe740
+        if (!(jsonstr = virJSONValueToString(data->propssrc[i], true)))
fbe740
+            return -1;
fbe740
+
fbe740
+        virBufferAdd(&buf, jsonstr, -1);
fbe740
+    }
fbe740
+
fbe740
+    actual = virBufferContentAndReset(&buf;;
fbe740
+
fbe740
+    return virTestCompareToFile(actual, jsonpath);
fbe740
+}
fbe740
+
fbe740
+
fbe740
+
fbe740
 struct testQemuImageCreateData {
fbe740
     const char *name;
fbe740
     const char *backingname;
fbe740
@@ -515,36 +546,6 @@ testQemuImageCreate(const void *opaque)
fbe740
 }
fbe740
 
fbe740
 
fbe740
-static int
fbe740
-testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque)
fbe740
-{
fbe740
-    struct testQemuDiskXMLToJSONData *data = (void *) opaque;
fbe740
-    g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
fbe740
-    g_autofree char *jsonpath = NULL;
fbe740
-    g_autofree char *actual = NULL;
fbe740
-    size_t i;
fbe740
-
fbe740
-    if (data->fail)
fbe740
-        return EXIT_AM_SKIP;
fbe740
-
fbe740
-    jsonpath = g_strdup_printf("%s%s-srconly.json", testQemuDiskXMLToJSONPath,
fbe740
-                               data->name);
fbe740
-
fbe740
-    for (i = 0; i < data->npropssrc; i++) {
fbe740
-        g_autofree char *jsonstr = NULL;
fbe740
-
fbe740
-        if (!(jsonstr = virJSONValueToString(data->propssrc[i], true)))
fbe740
-            return -1;
fbe740
-
fbe740
-        virBufferAdd(&buf, jsonstr, -1);
fbe740
-    }
fbe740
-
fbe740
-    actual = virBufferContentAndReset(&buf;;
fbe740
-
fbe740
-    return virTestCompareToFile(actual, jsonpath);
fbe740
-}
fbe740
-
fbe740
-
fbe740
 static const char *bitmapDetectPrefix = "qemublocktestdata/bitmap/";
fbe740
 
fbe740
 static void
fbe740
-- 
fbe740
2.26.0
fbe740