1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

virdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary()

After previous cleanups, there's just one caller of
dnsmasqCapsNewEmpty() and it is dnsmasqCapsNewFromBinary().
And the former is pretty short. Therefore, it is not necessary
for the code to live in two separate functions. Dissolve the
former in the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-12 05:58:39 +01:00
parent d730392293
commit 11627e021d

View File

@ -661,13 +661,14 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps)
return dnsmasqCapsSetFromBuffer(caps, version);
}
static dnsmasqCaps *
dnsmasqCapsNewEmpty(void)
dnsmasqCaps *
dnsmasqCapsNewFromBinary(void)
{
g_autoptr(dnsmasqCaps) caps = NULL;
if (dnsmasqCapsInitialize() < 0)
return NULL;
if (!(caps = virObjectNew(dnsmasqCapsClass)))
return NULL;
@ -677,17 +678,6 @@ dnsmasqCapsNewEmpty(void)
return NULL;
}
return g_steal_pointer(&caps);
}
dnsmasqCaps *
dnsmasqCapsNewFromBinary(void)
{
g_autoptr(dnsmasqCaps) caps = dnsmasqCapsNewEmpty();
if (!caps)
return NULL;
if (dnsmasqCapsRefreshInternal(caps) < 0)
return NULL;