From nobody Sun Feb 8 12:13:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571438266; cv=none; d=zoho.com; s=zohoarc; b=AH4l6MIDI5/25eGtS2RkfWCDqrAygpiFlZOuJVVvXQTbUYxuDE2E4qwL6xlsOt+aG+A47eHKuW7zrt3Prb6BmO/jJpNAs+XtDKYtSY+zfQS2Uc5UB7b2O/vpqoo8tJbfi03aZgesgN7aRq/Caxp4Ota6Y37DosJCisN7POwLNGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571438266; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3sqlNyufHPdANXH5N+d+AiAckk7QXA2gGlUd3tkkx0o=; b=hbT+jJJX5mlj/OGsFJV/i2P3csNwRwvslJUKSU65wgelvUqNM1ON3XIDC5QMS/NVU2iaxW6RCghcfGk0JH+X8F9fwR5A9v5r6tq6RpUTy1uRENmW0mo6sS7T4Nc1WuSUChbJ61jMSTtGwRQnoWbo8pOMeW+Jwa8WhF5ze3Xd6Ts= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571438266798700.0607016174107; Fri, 18 Oct 2019 15:37:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AA4A8A1C80; Fri, 18 Oct 2019 22:37:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E7FE819C7F; Fri, 18 Oct 2019 22:37:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A7774180B761; Fri, 18 Oct 2019 22:37:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9IMbAGM025261 for ; Fri, 18 Oct 2019 18:37:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 798235D71C; Fri, 18 Oct 2019 22:37:10 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-21.brq.redhat.com [10.40.200.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B52B5D713 for ; Fri, 18 Oct 2019 22:37:09 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 19 Oct 2019 00:37:46 +0200 Message-Id: <9fdb6beb76e26e7a59397c49fd7c6a25dfa3db35.1571438247.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/10] virsh: use g_strdup in cmdDomblkinfoGet X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Fri, 18 Oct 2019 22:37:45 +0000 (UTC) Prefer GLib's g_strdup to vshStrdup. Signed-off-by: J=C3=A1n Tomko --- tools/virsh-domain-monitor.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index cd675df07d..739c8df381 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -420,17 +420,16 @@ static const vshCmdOptDef opts_domblkinfo[] =3D { }; =20 static bool -cmdDomblkinfoGet(vshControl *ctl, - const virDomainBlockInfo *info, +cmdDomblkinfoGet(const virDomainBlockInfo *info, char **cap, char **alloc, char **phy, bool human) { if (info->capacity =3D=3D 0 && info->allocation =3D=3D 0 && info->phys= ical =3D=3D 0) { - *cap =3D vshStrdup(ctl, "-"); - *alloc =3D vshStrdup(ctl, "-"); - *phy =3D vshStrdup(ctl, "-"); + *cap =3D g_strdup("-"); + *alloc =3D g_strdup("-"); + *phy =3D g_strdup("-"); } else if (!human) { if (virAsprintf(cap, "%llu", info->capacity) < 0 || virAsprintf(alloc, "%llu", info->allocation) < 0 || @@ -530,7 +529,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) memset(&info, 0, sizeof(info)); } =20 - if (!cmdDomblkinfoGet(ctl, &info, &cap, &alloc, &phy, human)) + if (!cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human)) goto cleanup; if (vshTableRowAppend(table, target, cap, alloc, phy, NULL) < = 0) goto cleanup; @@ -545,7 +544,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) if (virDomainGetBlockInfo(dom, device, &info, 0) < 0) goto cleanup; =20 - if (!cmdDomblkinfoGet(ctl, &info, &cap, &alloc, &phy, human)) + if (!cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human)) goto cleanup; vshPrint(ctl, "%-15s %s\n", _("Capacity:"), cap); vshPrint(ctl, "%-15s %s\n", _("Allocation:"), alloc); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list