]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virdnsmasq: Drop mtime member from struct _dnsmasqCaps
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Jan 2022 12:19:26 +0000 (13:19 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 18 Jan 2022 14:19:47 +0000 (15:19 +0100)
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>
src/util/virdnsmasq.c

index 7fcaadda3f0fe1896cea2583d32def1ad45d0b74..c3801d622f7f7779ad984149e4f618a990b263b8 100644 (file)
@@ -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.