]> xenbits.xensource.com Git - libvirt.git/commitdiff
cpu: use g_auto() for all virBuffers
authorLaine Stump <laine@redhat.com>
Fri, 3 Jul 2020 02:36:24 +0000 (22:36 -0400)
committerLaine Stump <laine@redhat.com>
Wed, 8 Jul 2020 20:34:38 +0000 (16:34 -0400)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/cpu/cpu_map.c
src/cpu/cpu_x86.c

index 4465ebfa7ba58b418d78a094de49882b2daff1b2..d14488f8aa17d9f9ed86372b0104f535173247dc 100644 (file)
@@ -171,7 +171,7 @@ int cpuMapLoad(const char *arch,
 {
     xmlDocPtr xml = NULL;
     xmlXPathContextPtr ctxt = NULL;
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
+    g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     char *xpath = NULL;
     int ret = -1;
     char *mapfile;
index bf26cf4e766d79ee954f98abdba8b07506fcd2d4..1e5cd93abb1d885796689b7ed15719800e9f0c59 100644 (file)
@@ -972,7 +972,7 @@ x86FeatureNames(virCPUx86MapPtr map,
                 const char *separator,
                 virCPUx86Data *data)
 {
-    virBuffer ret = VIR_BUFFER_INITIALIZER;
+    g_auto(virBuffer) ret = VIR_BUFFER_INITIALIZER;
     bool first = true;
     size_t i;
 
@@ -1208,7 +1208,7 @@ virCPUx86SignaturesMatch(virCPUx86SignaturesPtr sigs,
 static char *
 virCPUx86SignaturesFormat(virCPUx86SignaturesPtr sigs)
 {
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
+    g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     size_t i;
 
     if (!sigs)
@@ -1707,7 +1707,7 @@ virCPUx86DataFormat(const virCPUData *data)
 {
     virCPUx86DataIterator iter;
     virCPUx86DataItemPtr item;
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
+    g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
 
     virCPUx86DataIteratorInit(&iter, &data->data.x86);