]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: remove unread variables
authorJán Tomko <jtomko@redhat.com>
Sun, 2 Aug 2020 21:33:07 +0000 (23:33 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 3 Aug 2020 13:19:29 +0000 (15:19 +0200)
Some of libvirt APIs return the number of elements, but we
don't need them, only whether the API failed or not.

Delete the redundant variables.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
tools/virsh-domain.c
tools/virt-admin.c

index aaf3b9a6a50806bf2ca4f602601c914778390758..97d64276386d008d555a1a337a2088fcb4511665 100644 (file)
@@ -6886,7 +6886,6 @@ virshVcpuinfoInactive(vshControl *ctl,
 {
     g_autofree unsigned char *cpumaps = NULL;
     size_t cpumaplen;
-    int ncpus;
     g_autoptr(virBitmap) vcpus = NULL;
     ssize_t nextvcpu = -1;
     bool first = true;
@@ -6897,9 +6896,9 @@ virshVcpuinfoInactive(vshControl *ctl,
     cpumaplen = VIR_CPU_MAPLEN(maxcpu);
     cpumaps = vshMalloc(ctl, virBitmapSize(vcpus) * cpumaplen);
 
-    if ((ncpus = virDomainGetVcpuPinInfo(dom, virBitmapSize(vcpus),
-                                         cpumaps, cpumaplen,
-                                         VIR_DOMAIN_AFFECT_CONFIG)) < 0)
+    if (virDomainGetVcpuPinInfo(dom, virBitmapSize(vcpus),
+                                cpumaps, cpumaplen,
+                                VIR_DOMAIN_AFFECT_CONFIG) < 0)
         return false;
 
     while ((nextvcpu = virBitmapNextSetBit(vcpus, nextvcpu)) >= 0) {
index f19b37dbb33dab46c6a73ed3805703a9a72036f4..8240d148b0145d85604ebe45af5b43bf2a8285bb 100644 (file)
@@ -1037,7 +1037,6 @@ static const vshCmdOptDef opts_daemon_log_filters[] = {
 static bool
 cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd)
 {
-    int nfilters;
     char *filters = NULL;
     vshAdmControlPtr priv = ctl->privData;
 
@@ -1049,8 +1048,8 @@ cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd)
             return false;
         }
     } else {
-        if ((nfilters = virAdmConnectGetLoggingFilters(priv->conn,
-                                                       &filters, 0)) < 0) {
+        if (virAdmConnectGetLoggingFilters(priv->conn,
+                                           &filters, 0) < 0) {
             vshError(ctl, _("Unable to get daemon logging filters information"));
             return false;
         }
@@ -1091,7 +1090,6 @@ static const vshCmdOptDef opts_daemon_log_outputs[] = {
 static bool
 cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd)
 {
-    int noutputs;
     char *outputs = NULL;
     vshAdmControlPtr priv = ctl->privData;
 
@@ -1103,8 +1101,7 @@ cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd)
             return false;
         }
     } else {
-        if ((noutputs = virAdmConnectGetLoggingOutputs(priv->conn,
-                                                       &outputs, 0)) < 0) {
+        if (virAdmConnectGetLoggingOutputs(priv->conn, &outputs, 0) < 0) {
             vshError(ctl, _("Unable to get daemon logging outputs information"));
             return false;
         }