]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: qemu: Remove 'skipKey' argument from virQEMUBuildCommandLineJSONArrayFormatFunc...
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Dec 2022 08:59:36 +0000 (09:59 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 4 Jan 2023 13:01:16 +0000 (14:01 +0100)
Since we really only need to handle key skipping in the top level object
the caller doesn't at this point even pass it to the array formatting
helper function. Remove the unused argument.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virqemu.c
src/util/virqemu.h

index 15602e30db339944782e318a517aed91a7dfca4f..b9e57a6f4c090eaf88dbf2c103bbf4d04b263515 100644 (file)
@@ -53,8 +53,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
 int
 virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
                                        virJSONValue *array,
-                                       virBuffer *buf,
-                                       const char *skipKey G_GNUC_UNUSED)
+                                       virBuffer *buf)
 {
     ssize_t pos = -1;
     ssize_t end;
@@ -90,8 +89,7 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
 int
 virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
                                          virJSONValue *array,
-                                         virBuffer *buf,
-                                         const char *skipKey)
+                                         virBuffer *buf)
 {
     virJSONValue *member;
     size_t i;
@@ -102,7 +100,7 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
         member = virJSONValueArrayGet((virJSONValue *) array, i);
         prefix = g_strdup_printf("%s.%zu", key, i);
 
-        if (virQEMUBuildCommandLineJSONRecurse(prefix, member, buf, skipKey,
+        if (virQEMUBuildCommandLineJSONRecurse(prefix, member, buf, NULL,
                                                virQEMUBuildCommandLineJSONArrayNumbered,
                                                true) < 0)
             return 0;
@@ -127,8 +125,7 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
 int
 virQEMUBuildCommandLineJSONArrayObjectsStr(const char *key,
                                            virJSONValue *array,
-                                           virBuffer *buf,
-                                           const char *skipKey G_GNUC_UNUSED)
+                                           virBuffer *buf)
 {
     g_auto(virBuffer) tmp = VIR_BUFFER_INITIALIZER;
     size_t i;
@@ -221,7 +218,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
             return -1;
         }
 
-        if (arrayFunc(key, value, buf, NULL) < 0) {
+        if (arrayFunc(key, value, buf) < 0) {
             /* fallback, treat the array as a non-bitmap, adding the key
              * for each member */
             for (i = 0; i < virJSONValueArraySize(value); i++) {
index 472f24de53c1f6cabdfb7af47e4e0da07ea3d7ae..be083d75458fa399c76fa5a4c19f979dce7d2d27 100644 (file)
 
 typedef int (*virQEMUBuildCommandLineJSONArrayFormatFunc)(const char *key,
                                                           virJSONValue *array,
-                                                          virBuffer *buf,
-                                                          const char *skipKey);
+                                                          virBuffer *buf);
 int virQEMUBuildCommandLineJSONArrayObjectsStr(const char *key,
                                                virJSONValue *array,
-                                               virBuffer *buf,
-                                               const char *skipKey);
+                                               virBuffer *buf);
 int virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
                                            virJSONValue *array,
-                                           virBuffer *buf,
-                                           const char *skipKey);
+                                           virBuffer *buf);
 int virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
                                              virJSONValue *array,
-                                             virBuffer *buf,
-                                             const char *skipKey);
+                                             virBuffer *buf);
 
 int virQEMUBuildCommandLineJSON(virJSONValue *value,
                                 virBuffer *buf,