mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 22:13:18 +00:00
chExtractVersion: Drop @ret
After previous patches, the @ret variable and the 'cleanup' label are redundant. Remove them. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
4292d4b786
commit
da53324a79
@ -194,7 +194,6 @@ virCHDriverConfigDispose(void *obj)
|
|||||||
int
|
int
|
||||||
chExtractVersion(virCHDriver *driver)
|
chExtractVersion(virCHDriver *driver)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
unsigned long version;
|
unsigned long version;
|
||||||
g_autofree char *help = NULL;
|
g_autofree char *help = NULL;
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
@ -209,7 +208,7 @@ chExtractVersion(virCHDriver *driver)
|
|||||||
virCommandSetOutputBuffer(cmd, &help);
|
virCommandSetOutputBuffer(cmd, &help);
|
||||||
|
|
||||||
if (virCommandRun(cmd, NULL) < 0)
|
if (virCommandRun(cmd, NULL) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
tmp = help;
|
tmp = help;
|
||||||
|
|
||||||
@ -217,24 +216,21 @@ chExtractVersion(virCHDriver *driver)
|
|||||||
if ((tmp = STRSKIP(tmp, "cloud-hypervisor v")) == NULL) {
|
if ((tmp = STRSKIP(tmp, "cloud-hypervisor v")) == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Unexpected output of cloud-hypervisor binary"));
|
_("Unexpected output of cloud-hypervisor binary"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virParseVersionString(tmp, &version, true) < 0) {
|
if (virParseVersionString(tmp, &version, true) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unable to parse cloud-hypervisor version: %s"), tmp);
|
_("Unable to parse cloud-hypervisor version: %s"), tmp);
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version < MIN_VERSION) {
|
if (version < MIN_VERSION) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Cloud-Hypervisor version is too old (v15.0 is the minimum supported version)"));
|
_("Cloud-Hypervisor version is too old (v15.0 is the minimum supported version)"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
driver->version = version;
|
driver->version = version;
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user