[PATCH v2 2/4] virsh: remove variable 'ret' in cmdVersion()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx>
---
 tools/virsh-host.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index b602696704..6f306fffe3 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -1350,7 +1350,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;
@@ -1370,8 +1369,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;
     }
@@ -1389,8 +1387,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;
     }
@@ -1408,8 +1405,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;
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux