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 <artem.chernyshev@xxxxxxxxxxx> --- 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[] = { {.name = NULL} }; -static bool +static void cmdDomblkinfoGet(const virDomainBlockInfo *info, char **cap, char **alloc, @@ -436,8 +436,6 @@ cmdDomblkinfoGet(const virDomainBlockInfo *info, *alloc = g_strdup_printf("%.3lf %s", val_alloc, unit_alloc); *phy = g_strdup_printf("%.3lf %s", val_phy, unit_phy); } - - return true; } @@ -515,8 +513,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) } } - 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; - 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); -- 2.43.0 _______________________________________________ Devel mailing list -- devel@xxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx