]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: string: Remove the 'virString' type
authorPeter Krempa <pkrempa@redhat.com>
Tue, 26 Feb 2019 15:17:54 +0000 (16:17 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 4 Mar 2019 12:04:20 +0000 (13:04 +0100)
We don't need it as there's a separate macro for auto-freeing of string
lists.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/util/virstring.h
src/xenconfig/xen_common.c

index d14b7f4f498a6f9a1b5f057dc51d0aa21068486d..f2e72936c84804de4b1ad4c46490ec3e2cad16bf 100644 (file)
@@ -24,8 +24,6 @@
 # include "internal.h"
 # include "viralloc.h"
 
-typedef char *virString;
-
 char **virStringSplitCount(const char *string,
                            const char *delim,
                            size_t max_tokens,
@@ -317,6 +315,4 @@ int virStringParsePort(const char *str,
 # define VIR_AUTOSTRINGLIST \
         __attribute__((cleanup(virStringListAutoFree))) char **
 
-VIR_DEFINE_AUTOPTR_FUNC(virString, virStringListFree);
-
 #endif /* LIBVIRT_VIRSTRING_H */
index 2c8179f19c9a7ffc6f0e75ce501cbd7ee3c02c65..21c56edd5849516b5ae26879f88a77e013eaa84f 100644 (file)
@@ -474,14 +474,14 @@ static int
 xenParsePCIList(virConfPtr conf, virDomainDefPtr def)
 {
     VIR_AUTOSTRINGLIST pcis = NULL;
-    virString *entries = NULL;
+    char **entries = NULL;
     int rc;
 
     if ((rc = virConfGetValueStringList(conf, "pci", false, &pcis)) <= 0)
         return xenHandleConfGetValueStringListErrors(rc);
 
     for (entries = pcis; *entries; entries++) {
-        virString entry = *entries;
+        char *entry = *entries;
         virDomainHostdevDefPtr hostdev;
 
         if (!(hostdev = xenParsePCI(entry)))
@@ -789,7 +789,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat)
 
         /* Try to get the list of values to support multiple serial ports */
         if ((rc = virConfGetValueStringList(conf, "serial", false, &serials)) == 1) {
-            virString *entries;
+            char **entries;
             int portnum = -1;
 
             if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
@@ -799,7 +799,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat)
             }
 
             for (entries = serials; *entries; entries++) {
-                virString port = *entries;
+                char *port = *entries;
 
                 portnum++;
                 if (STREQ(port, "none"))