]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Replace virStringListJoin by g_strjoinv
authorPeter Krempa <pkrempa@redhat.com>
Fri, 5 Feb 2021 20:33:47 +0000 (21:33 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 11 Feb 2021 16:05:34 +0000 (17:05 +0100)
Our implementation was inspired by glib anyways. The difference is only
the order of arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/bhyve/bhyve_parse_command.c
src/libxl/xen_common.c
src/libxl/xen_xl.c
src/qemu/qemu_process.c
src/storage_file/storage_source_backingstore.c
src/util/vircgroup.c

index 4f1d384da1f0990026d22a865996f41a58dfb76a..2762b7e921367efa83b5621d78cea3807bc6f49b 100644 (file)
@@ -923,7 +923,7 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def,
         /* Set os.bootloader since virDomainDefFormatInternal will only format
          * the bootloader arguments if os->bootloader is set. */
         def->os.bootloader = g_strdup(argv[0]);
-        def->os.bootloaderArgs = virStringListJoin((const char**) &argv[1], " ");
+        def->os.bootloaderArgs = g_strjoinv(" ", &argv[1]);
     }
 
     if (def->name == NULL) {
@@ -950,7 +950,7 @@ bhyveParseCustomLoaderCommandLine(virDomainDefPtr def,
         return -1;
 
     def->os.bootloader = g_strdup(argv[0]);
-    def->os.bootloaderArgs = virStringListJoin((const char**) &argv[1], " ");
+    def->os.bootloaderArgs = g_strjoinv(" ", &argv[1]);
 
     return 0;
 }
index 75c65a4135ef02d2a24cbf63f250793298ebee20..f852032d8a552caee80ff9e6a31f642bca932433 100644 (file)
@@ -1659,7 +1659,7 @@ xenMakeIPList(virNetDevIPInfoPtr guestIP)
         if (!address_array[i])
             goto cleanup;
     }
-    ret = virStringListJoin((const char**)address_array, " ");
+    ret = g_strjoinv(" ", address_array);
 
  cleanup:
     g_strfreev(address_array);
index 46c08d550c6ad4a004e18553350803f1d4e2d343..494b5f3dd247d3d180869ac6aaad085b079ba277 100644 (file)
@@ -1421,9 +1421,7 @@ xenFormatXLCPUID(virConfPtr conf, virDomainDefPtr def)
     cpuid_pairs[j] = NULL;
 
     if (j > 1) {
-        cpuid_string = virStringListJoin((const char **)cpuid_pairs, ",");
-        if (!cpuid_string)
-            goto cleanup;
+        cpuid_string = g_strjoinv(",", cpuid_pairs);
 
         if (xenConfigSetString(conf, "cpuid", cpuid_string) < 0)
             goto cleanup;
index ff5b0585fb6350ee3e48f45f0fca2dcd52da1574..b95f7514bab7e933e3ff1de3c24713c7882b35c2 100644 (file)
@@ -5489,7 +5489,7 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
             if (n > 0) {
                 g_autofree char *str = NULL;
 
-                str = virStringListJoin((const char **)features, ", ");
+                str = g_strjoinv(", ", features);
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                                _("Some features cannot be reliably used "
                                  "with this QEMU: %s"), str);
index 8e1606a1fed37edb56037ebe3b08a23a02b4477f..5e2db3d3903da63803182af7ed1ae9142f1143e2 100644 (file)
@@ -168,9 +168,7 @@ virStorageSourceRBDAddHost(virStorageSourcePtr src,
     parts = g_strsplit(hostport, "\\:", 0);
     if (!parts)
         goto error;
-    src->hosts[src->nhosts-1].name = virStringListJoin((const char **)parts, ":");
-    if (!src->hosts[src->nhosts-1].name)
-        goto error;
+    src->hosts[src->nhosts-1].name = g_strjoinv(":", parts);
 
     src->hosts[src->nhosts-1].transport = VIR_STORAGE_NET_HOST_TRANS_TCP;
     src->hosts[src->nhosts-1].socket = NULL;
index e3137f61fb91f30e57eec5987ad9b5094393af00..57e18d6f3828f488fe186d52ef695051e57ae504 100644 (file)
@@ -881,7 +881,7 @@ virCgroupSetPartitionSuffix(const char *path, char **res)
             goto cleanup;
     }
 
-    if (!(*res = virStringListJoin((const char **)tokens, "/")))
+    if (!(*res = g_strjoinv("/", tokens)))
         goto cleanup;
 
     ret = 0;