mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03:00
virdnsmasq: Drop mtime member from struct _dnsmasqCaps
The _dnsmasqCaps struct has @mtime member which holds the mtime of the dnsmasq binary. The idea was that capabilities don't need to be queried if mtime hasn't changed since the last time. However, the code that would try to query capabilities again was removed and now we are left with code that stores mtime but has no use for it. Remove the member and code that uses it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
bc9fea6237
commit
0a7224a147
@ -577,7 +577,6 @@ struct _dnsmasqCaps {
|
||||
virObject parent;
|
||||
char *binaryPath;
|
||||
bool noRefresh;
|
||||
time_t mtime;
|
||||
unsigned long version;
|
||||
};
|
||||
|
||||
@ -651,7 +650,6 @@ dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf)
|
||||
static int
|
||||
dnsmasqCapsRefreshInternal(dnsmasqCaps *caps)
|
||||
{
|
||||
struct stat sb;
|
||||
g_autoptr(virCommand) vercmd = NULL;
|
||||
g_autoptr(virCommand) helpcmd = NULL;
|
||||
g_autofree char *help = NULL;
|
||||
@ -661,15 +659,6 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps)
|
||||
if (!caps || caps->noRefresh)
|
||||
return 0;
|
||||
|
||||
if (stat(caps->binaryPath, &sb) < 0) {
|
||||
virReportSystemError(errno, _("Cannot check dnsmasq binary %s"),
|
||||
caps->binaryPath);
|
||||
return -1;
|
||||
}
|
||||
if (caps->mtime == sb.st_mtime)
|
||||
return 0;
|
||||
caps->mtime = sb.st_mtime;
|
||||
|
||||
/* Make sure the binary we are about to try exec'ing exists.
|
||||
* Technically we could catch the exec() failure, but that's
|
||||
* in a sub-process so it's hard to feed back a useful error.
|
||||
|
Loading…
Reference in New Issue
Block a user