1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-09 01:18:00 +03:00

virsh: remove variable 'ret' in cmdVersion()

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Kristina Hanicova 2021-09-24 01:49:09 +02:00 committed by Michal Privoznik
parent 28051aaa9b
commit 409ccebcaa

View File

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