util: string: Remove the 'virString' type

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>
This commit is contained in:
Peter Krempa 2019-02-26 16:17:54 +01:00
parent bd734bbbce
commit cf3c525a45
2 changed files with 4 additions and 8 deletions

View File

@ -24,8 +24,6 @@
# include "internal.h" # include "internal.h"
# include "viralloc.h" # include "viralloc.h"
typedef char *virString;
char **virStringSplitCount(const char *string, char **virStringSplitCount(const char *string,
const char *delim, const char *delim,
size_t max_tokens, size_t max_tokens,
@ -317,6 +315,4 @@ int virStringParsePort(const char *str,
# define VIR_AUTOSTRINGLIST \ # define VIR_AUTOSTRINGLIST \
__attribute__((cleanup(virStringListAutoFree))) char ** __attribute__((cleanup(virStringListAutoFree))) char **
VIR_DEFINE_AUTOPTR_FUNC(virString, virStringListFree);
#endif /* LIBVIRT_VIRSTRING_H */ #endif /* LIBVIRT_VIRSTRING_H */

View File

@ -474,14 +474,14 @@ static int
xenParsePCIList(virConfPtr conf, virDomainDefPtr def) xenParsePCIList(virConfPtr conf, virDomainDefPtr def)
{ {
VIR_AUTOSTRINGLIST pcis = NULL; VIR_AUTOSTRINGLIST pcis = NULL;
virString *entries = NULL; char **entries = NULL;
int rc; int rc;
if ((rc = virConfGetValueStringList(conf, "pci", false, &pcis)) <= 0) if ((rc = virConfGetValueStringList(conf, "pci", false, &pcis)) <= 0)
return xenHandleConfGetValueStringListErrors(rc); return xenHandleConfGetValueStringListErrors(rc);
for (entries = pcis; *entries; entries++) { for (entries = pcis; *entries; entries++) {
virString entry = *entries; char *entry = *entries;
virDomainHostdevDefPtr hostdev; virDomainHostdevDefPtr hostdev;
if (!(hostdev = xenParsePCI(entry))) 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 */ /* Try to get the list of values to support multiple serial ports */
if ((rc = virConfGetValueStringList(conf, "serial", false, &serials)) == 1) { if ((rc = virConfGetValueStringList(conf, "serial", false, &serials)) == 1) {
virString *entries; char **entries;
int portnum = -1; int portnum = -1;
if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) { if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
@ -799,7 +799,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat)
} }
for (entries = serials; *entries; entries++) { for (entries = serials; *entries; entries++) {
virString port = *entries; char *port = *entries;
portnum++; portnum++;
if (STREQ(port, "none")) if (STREQ(port, "none"))