]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: remove variable 'ret' in cmdVersion()
authorKristina Hanicova <khanicov@redhat.com>
Thu, 23 Sep 2021 23:49:09 +0000 (01:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 24 Sep 2021 07:58:04 +0000 (09:58 +0200)
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-host.c

index 881d4c762fefc3fe4055c324cb4de99593ac40bd..2a84c58be78ffa435149708fdefe28439f5a6197 100644 (file)
@@ -1349,7 +1349,6 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
     unsigned long includeVersion;
     unsigned long apiVersion;
     unsigned long daemonVersion;
-    int ret;
     unsigned int major;
     unsigned int minor;
     unsigned int rel;
@@ -1369,8 +1368,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
     vshPrint(ctl, _("Compiled against library: libvirt %d.%d.%d\n"),
              major, minor, rel);
 
-    ret = virGetVersion(&libVersion, hvType, &apiVersion);
-    if (ret < 0) {
+    if (virGetVersion(&libVersion, hvType, &apiVersion) < 0) {
         vshError(ctl, "%s", _("failed to get the library version"));
         return false;
     }
@@ -1388,8 +1386,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
     vshPrint(ctl, _("Using API: %s %d.%d.%d\n"), hvType,
              major, minor, rel);
 
-    ret = virConnectGetVersion(priv->conn, &hvVersion);
-    if (ret < 0) {
+    if (virConnectGetVersion(priv->conn, &hvVersion) < 0) {
         vshError(ctl, "%s", _("failed to get the hypervisor version"));
         return false;
     }
@@ -1407,8 +1404,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
     }
 
     if (vshCommandOptBool(cmd, "daemon")) {
-        ret = virConnectGetLibVersion(priv->conn, &daemonVersion);
-        if (ret < 0) {
+        if (virConnectGetLibVersion(priv->conn, &daemonVersion) < 0) {
             vshError(ctl, "%s", _("failed to get the daemon version"));
         } else {
             major = daemonVersion / 1000000;