util: dnsmasq: remove caps completely

Now that we only check whether the dnsmasq version is new enough,
there is no need for the caps field.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Ján Tomko 2021-12-14 19:45:14 +01:00
parent cd74b24fdf
commit 2f9ad6537b
3 changed files with 0 additions and 23 deletions

View File

@ -2112,7 +2112,6 @@ virIsDevMapperDevice;
# util/virdnsmasq.h # util/virdnsmasq.h
dnsmasqAddDhcpHost; dnsmasqAddDhcpHost;
dnsmasqAddHost; dnsmasqAddHost;
dnsmasqCapsGet;
dnsmasqCapsGetBinaryPath; dnsmasqCapsGetBinaryPath;
dnsmasqCapsNewFromBinary; dnsmasqCapsNewFromBinary;
dnsmasqCapsNewFromBuffer; dnsmasqCapsNewFromBuffer;

View File

@ -578,7 +578,6 @@ struct _dnsmasqCaps {
char *binaryPath; char *binaryPath;
bool noRefresh; bool noRefresh;
time_t mtime; time_t mtime;
virBitmap *flags;
unsigned long version; unsigned long version;
}; };
@ -589,7 +588,6 @@ dnsmasqCapsDispose(void *obj)
{ {
dnsmasqCaps *caps = obj; dnsmasqCaps *caps = obj;
virBitmapFree(caps->flags);
g_free(caps->binaryPath); g_free(caps->binaryPath);
} }
@ -603,13 +601,6 @@ static int dnsmasqCapsOnceInit(void)
VIR_ONCE_GLOBAL_INIT(dnsmasqCaps); VIR_ONCE_GLOBAL_INIT(dnsmasqCaps);
static void
dnsmasqCapsSet(dnsmasqCaps *caps,
dnsmasqCapsFlags flag)
{
ignore_value(virBitmapSetBit(caps->flags, flag));
}
#define DNSMASQ_VERSION_STR "Dnsmasq version " #define DNSMASQ_VERSION_STR "Dnsmasq version "
@ -717,7 +708,6 @@ dnsmasqCapsNewEmpty(const char *binaryPath)
return NULL; return NULL;
if (!(caps = virObjectNew(dnsmasqCapsClass))) if (!(caps = virObjectNew(dnsmasqCapsClass)))
return NULL; return NULL;
caps->flags = virBitmapNew(DNSMASQ_CAPS_LAST);
caps->binaryPath = g_strdup(binaryPath ? binaryPath : DNSMASQ); caps->binaryPath = g_strdup(binaryPath ? binaryPath : DNSMASQ);
return caps; return caps;
} }
@ -758,13 +748,6 @@ dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps)
return caps ? caps->binaryPath : DNSMASQ; return caps ? caps->binaryPath : DNSMASQ;
} }
bool
dnsmasqCapsGet(dnsmasqCaps *caps, dnsmasqCapsFlags flag)
{
return caps && virBitmapIsBitSet(caps->flags, flag);
}
/** dnsmasqDhcpHostsToString: /** dnsmasqDhcpHostsToString:
* *
* Turns a vector of dnsmasqDhcpHost into the string that is ought to be * Turns a vector of dnsmasqDhcpHost into the string that is ought to be

View File

@ -67,10 +67,6 @@ typedef struct
dnsmasqAddnHostsfile *addnhostsfile; dnsmasqAddnHostsfile *addnhostsfile;
} dnsmasqContext; } dnsmasqContext;
typedef enum {
DNSMASQ_CAPS_LAST, /* this must always be the last item */
} dnsmasqCapsFlags;
typedef struct _dnsmasqCaps dnsmasqCaps; typedef struct _dnsmasqCaps dnsmasqCaps;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(dnsmasqCaps, virObjectUnref); G_DEFINE_AUTOPTR_CLEANUP_FUNC(dnsmasqCaps, virObjectUnref);
@ -97,7 +93,6 @@ int dnsmasqReload(pid_t pid);
dnsmasqCaps *dnsmasqCapsNewFromBuffer(const char *buf); dnsmasqCaps *dnsmasqCapsNewFromBuffer(const char *buf);
dnsmasqCaps *dnsmasqCapsNewFromBinary(void); dnsmasqCaps *dnsmasqCapsNewFromBinary(void);
bool dnsmasqCapsGet(dnsmasqCaps *caps, dnsmasqCapsFlags flag);
const char *dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps); const char *dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps);
char *dnsmasqDhcpHostsToString(dnsmasqDhcpHost *hosts, char *dnsmasqDhcpHostsToString(dnsmasqDhcpHost *hosts,
unsigned int nhosts); unsigned int nhosts);