mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
ch_conf: Dissolve chExtractVersionInfo() in chExtractVersion()
After previous patches, there's not much value in chExtractVersion(). Rename chExtractVersionInfo() to chExtractVersion() and have it use virCHDriver directly. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b5fcd27a08
commit
da91bdf836
@ -191,8 +191,8 @@ virCHDriverConfigDispose(void *obj)
|
||||
|
||||
#define MIN_VERSION ((15 * 1000000) + (0 * 1000) + (0))
|
||||
|
||||
static int
|
||||
chExtractVersionInfo(int *retversion)
|
||||
int
|
||||
chExtractVersion(virCHDriver *driver)
|
||||
{
|
||||
int ret = -1;
|
||||
unsigned long version;
|
||||
@ -201,8 +201,6 @@ chExtractVersionInfo(int *retversion)
|
||||
g_autofree char *ch_cmd = g_find_program_in_path(CH_CMD);
|
||||
virCommand *cmd = virCommandNewArgList(ch_cmd, "--version", NULL);
|
||||
|
||||
*retversion = 0;
|
||||
|
||||
virCommandAddEnvString(cmd, "LC_ALL=C");
|
||||
virCommandSetOutputBuffer(cmd, &help);
|
||||
|
||||
@ -230,22 +228,10 @@ chExtractVersionInfo(int *retversion)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
*retversion = version;
|
||||
driver->version = version;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int chExtractVersion(virCHDriver *driver)
|
||||
{
|
||||
if (driver->version > 0)
|
||||
return 0;
|
||||
|
||||
if (chExtractVersionInfo(&driver->version) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user