Re: [PATCH 66/75] tools: Use g_strdup_printf() instead of virAsprintf()

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

 





On 10/22/19 10:58 AM, Michal Privoznik wrote:
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
  tools/virsh-completer-domain.c |  6 +++---
  tools/virsh-completer-host.c   | 10 +++++-----
  tools/virsh-completer.c        |  2 +-
  tools/virsh-domain-monitor.c   | 18 +++++++++---------
  tools/virsh-domain.c           | 22 +++++++++++-----------
  tools/virsh-host.c             |  2 +-
  tools/virsh-interface.c        |  2 +-
  tools/virsh-network.c          |  2 +-
  tools/virsh-pool.c             | 12 ++++++------
  tools/virsh-volume.c           |  6 +++---
  tools/virt-admin.c             |  4 ++--
  tools/vsh.c                    | 22 +++++++++++-----------
  12 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c
index 0bf6202c0a..d625ab8bb4 100644
--- a/tools/virsh-completer-domain.c
+++ b/tools/virsh-completer-domain.c
@@ -221,9 +221,9 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
      if (virMacAddrParse(iface, &macaddr) == 0)
          virMacAddrFormat(&macaddr, macstr);
- virAsprintf(&xpath, "/domain/devices/interface[(mac/@address = '%s') or "
-                "                          (target/@dev = '%s')]", macstr,
-                iface);
+    xpath = g_strdup_printf("/domain/devices/interface[(mac/@address = '%s') or "
+                            "                          (target/@dev = '%s')]", macstr,
+                            iface);
if ((ninterfaces = virXPathNodeSet(xpath, ctxt, &interfaces)) < 0)
          return NULL;
diff --git a/tools/virsh-completer-host.c b/tools/virsh-completer-host.c
index 8cb98ad88d..41615226d2 100644
--- a/tools/virsh-completer-host.c
+++ b/tools/virsh-completer-host.c
@@ -44,7 +44,7 @@ virshPagesizeNodeToString(xmlNodePtr node)
      if (virScaleInteger(&byteval, unit, 1024, UINT_MAX) < 0)
          return NULL;
      size = vshPrettyCapacity(byteval, &suffix);
-    virAsprintf(&ret, "%.0f%s", size, suffix);
+    ret = g_strdup_printf("%.0f%s", size, suffix);
      return ret;
  }
@@ -78,11 +78,11 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl,
          return NULL;
if (cellno && vshCommandOptStringQuiet(ctl, cmd, "cellno", &cellnum) > 0) {
-        virAsprintf(&path,
-                    "/capabilities/host/topology/cells/cell[@id=\"%s\"]/pages",
-                    cellnum);
+        path = g_strdup_printf(
+                               "/capabilities/host/topology/cells/cell[@id=\"%s\"]/pages",
+                               cellnum);


Extra newline after the '('.



Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>

--
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