mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
util: Stop storing dnsmasq version
We don't do anything with it after checking that it satisfies our requirements and don't provide a way for users of the module to access it, so carrying it around is pointless. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
cef015e325
commit
dbf9b8a6ed
@ -577,7 +577,6 @@ dnsmasqReload(pid_t pid G_GNUC_UNUSED)
|
|||||||
struct _dnsmasqCaps {
|
struct _dnsmasqCaps {
|
||||||
virObject parent;
|
virObject parent;
|
||||||
char *binaryPath;
|
char *binaryPath;
|
||||||
unsigned long version;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static virClass *dnsmasqCapsClass;
|
static virClass *dnsmasqCapsClass;
|
||||||
@ -608,6 +607,7 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf)
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
unsigned long version;
|
||||||
|
|
||||||
p = STRSKIP(buf, DNSMASQ_VERSION_STR);
|
p = STRSKIP(buf, DNSMASQ_VERSION_STR);
|
||||||
if (!p)
|
if (!p)
|
||||||
@ -615,21 +615,21 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf)
|
|||||||
|
|
||||||
virSkipToDigit(&p);
|
virSkipToDigit(&p);
|
||||||
|
|
||||||
if (virParseVersionString(p, &caps->version, true) < 0)
|
if (virParseVersionString(p, &version, true) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (caps->version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) {
|
if (version < DNSMASQ_MIN_MAJOR * 1000000 + DNSMASQ_MIN_MINOR * 1000) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("dnsmasq version >= %u.%u required but %lu.%lu found"),
|
_("dnsmasq version >= %u.%u required but %lu.%lu found"),
|
||||||
DNSMASQ_MIN_MAJOR, DNSMASQ_MIN_MINOR,
|
DNSMASQ_MIN_MAJOR, DNSMASQ_MIN_MINOR,
|
||||||
caps->version / 1000000,
|
version / 1000000,
|
||||||
caps->version % 1000000 / 1000);
|
version % 1000000 / 1000);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_INFO("dnsmasq version is %d.%d",
|
VIR_INFO("dnsmasq version is %d.%d",
|
||||||
(int)caps->version / 1000000,
|
(int)version / 1000000,
|
||||||
(int)(caps->version % 1000000) / 1000);
|
(int)(version % 1000000) / 1000);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user