[libvirt] [PATCH v2 3/4] util: string: Remove the 'virString' type

Peter Krempa pkrempa at redhat.com
Tue Feb 26 15:48:25 UTC 2019


We don't need it as there's a separate macro for auto-freeing of string
lists.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/util/virstring.h       | 4 ----
 src/xenconfig/xen_common.c | 8 ++++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/util/virstring.h b/src/util/virstring.h
index d14b7f4f49..f2e72936c8 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -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 */
diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index 2c8179f19c..21c56edd58 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -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"))
-- 
2.20.1




More information about the libvir-list mailing list