From nobody Tue Feb 10 23:54:48 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=red-soft.ru Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1703453908135617.0900705391778; Sun, 24 Dec 2023 13:38:28 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 10ABE1A7A; Sun, 24 Dec 2023 16:38:27 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 153631A39; Sun, 24 Dec 2023 16:35:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 739A519E4; Sun, 24 Dec 2023 16:35:06 -0500 (EST) Received: from gw.red-soft.ru (red-soft.ru [188.246.186.2]) by lists.libvirt.org (Postfix) with ESMTP id A269A19E4 for ; Sun, 24 Dec 2023 16:35:03 -0500 (EST) Received: from gentoo.darknet (unknown [10.81.10.243]) by gw.red-soft.ru (Postfix) with ESMTPA id 64A1A3E1BE2; Mon, 25 Dec 2023 00:26:10 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 535 seconds by postgrey-1.37 at lists.libvirt.org; Sun, 24 Dec 2023 16:35:03 EST From: Artem Chernyshev To: devel@lists.libvirt.org Subject: [PATCH 07/10] tools: cmdDomblkinfoGet() to void Date: Mon, 25 Dec 2023 00:26:00 +0300 Message-ID: <20231224212603.29506-8-artem.chernyshev@red-soft.ru> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231224212603.29506-1-artem.chernyshev@red-soft.ru> References: <20231224212603.29506-1-artem.chernyshev@red-soft.ru> MIME-Version: 1.0 X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 182326 [Dec 24 2023] X-KLMS-AntiSpam-Version: 6.1.0.3 X-KLMS-AntiSpam-Envelope-From: artem.chernyshev@red-soft.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;red-soft.ru:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2023/12/24 20:51:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/12/24 19:18:00 #22792569 X-KLMS-AntiVirus-Status: Clean, skipped Message-ID-Hash: J2TUXO4HYHU5IYC4RCLAFOXVKAU4JEEY X-Message-ID-Hash: J2TUXO4HYHU5IYC4RCLAFOXVKAU4JEEY X-MailFrom: artem.chernyshev@red-soft.ru X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Artem Chernyshev X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703453910108100001 cmdDomblkinfoGet() function returns an invariant result, so turn it to void. Remove all redundant check which depends on it returning value Fixes: 26a137093b ("tools: Use g_strdup_printf() instead of virAsprintf()") Signed-off-by: Artem Chernyshev --- tools/virsh-domain-monitor.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index a2c56fc090..db2b9c7294 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -409,7 +409,7 @@ static const vshCmdOptDef opts_domblkinfo[] =3D { {.name =3D NULL} }; =20 -static bool +static void cmdDomblkinfoGet(const virDomainBlockInfo *info, char **cap, char **alloc, @@ -436,8 +436,6 @@ cmdDomblkinfoGet(const virDomainBlockInfo *info, *alloc =3D g_strdup_printf("%.3lf %s", val_alloc, unit_alloc); *phy =3D g_strdup_printf("%.3lf %s", val_phy, unit_phy); } - - return true; } =20 =20 @@ -515,8 +513,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) } } =20 - if (!cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human)) - return false; + cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human); if (vshTableRowAppend(table, target, cap, alloc, phy, NULL) < = 0) return false; } @@ -532,8 +529,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) if (virDomainGetBlockInfo(dom, device, &info, 0) < 0) return false; =20 - if (!cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human)) - return false; + cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human); vshPrint(ctl, "%-15s %s\n", _("Capacity:"), cap); vshPrint(ctl, "%-15s %s\n", _("Allocation:"), alloc); vshPrint(ctl, "%-15s %s\n", _("Physical:"), phy); --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org