[PATCH 40/75] cpu: Use g_strdup_printf() instead of virAsprintf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/cpu/cpu_ppc64.c | 19 ++++++++-----------
 src/cpu/cpu_x86.c   | 14 ++++++--------
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 990bbbd45f..3236a9616e 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -460,9 +460,8 @@ ppc64Compute(virCPUDefPtr host,
             VIR_DEBUG("CPU arch %s does not match host arch",
                       virArchToString(cpu->arch));
             if (message)
-                virAsprintf(message,
-                            _("CPU arch %s does not match host arch"),
-                            virArchToString(cpu->arch));
+                *message = g_strdup_printf(_("CPU arch %s does not match host arch"),
+                                           virArchToString(cpu->arch));
 
             ret = VIR_CPU_COMPARE_INCOMPATIBLE;
             goto cleanup;
@@ -477,10 +476,9 @@ ppc64Compute(virCPUDefPtr host,
         VIR_DEBUG("host CPU vendor does not match required CPU vendor %s",
                   cpu->vendor);
         if (message) {
-            virAsprintf(message,
-                        _("host CPU vendor does not match required "
-                          "CPU vendor %s"),
-                        cpu->vendor);
+            *message = g_strdup_printf(_("host CPU vendor does not match required "
+                                         "CPU vendor %s"),
+                                       cpu->vendor);
         }
 
         ret = VIR_CPU_COMPARE_INCOMPATIBLE;
@@ -532,10 +530,9 @@ ppc64Compute(virCPUDefPtr host,
         VIR_DEBUG("host CPU model does not match required CPU model %s",
                   guest_model->name);
         if (message) {
-            virAsprintf(message,
-                        _("host CPU model does not match required "
-                          "CPU model %s"),
-                        guest_model->name);
+            *message = g_strdup_printf(_("host CPU model does not match required "
+                                         "CPU model %s"),
+                                       guest_model->name);
         }
 
         ret = VIR_CPU_COMPARE_INCOMPATIBLE;
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 8418339d6f..82403472df 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1725,7 +1725,7 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt)
                 goto error; \
             } \
             if (message) \
-                virAsprintf(message, "%s: %s", _(MSG), flagsStr); \
+                *message = g_strdup_printf("%s: %s", _(MSG), flagsStr); \
             VIR_DEBUG("%s: %s", MSG, flagsStr); \
             VIR_FREE(flagsStr); \
             ret = VIR_CPU_COMPARE_INCOMPATIBLE; \
@@ -1767,9 +1767,8 @@ x86Compute(virCPUDefPtr host,
             VIR_DEBUG("CPU arch %s does not match host arch",
                       virArchToString(cpu->arch));
             if (message) {
-                virAsprintf(message,
-                            _("CPU arch %s does not match host arch"),
-                            virArchToString(cpu->arch));
+                *message = g_strdup_printf(_("CPU arch %s does not match host arch"),
+                                           virArchToString(cpu->arch));
             }
             return VIR_CPU_COMPARE_INCOMPATIBLE;
         }
@@ -1783,10 +1782,9 @@ x86Compute(virCPUDefPtr host,
         VIR_DEBUG("host CPU vendor does not match required CPU vendor %s",
                   cpu->vendor);
         if (message) {
-            virAsprintf(message,
-                        _("host CPU vendor does not match required "
-                          "CPU vendor %s"),
-                        cpu->vendor);
+            *message = g_strdup_printf(_("host CPU vendor does not match required "
+                                         "CPU vendor %s"),
+                                       cpu->vendor);
         }
 
         return VIR_CPU_COMPARE_INCOMPATIBLE;
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux