return leasefile;
}
-networkDnsmasqLeaseFileNameFunc networkDnsmasqLeaseFileName =
- networkDnsmasqLeaseFileNameDefault;
-
static char *
networkDnsmasqLeaseFileNameCustom(const char *bridge)
{
goto cleanup;
}
- if (!(leasefile = networkDnsmasqLeaseFileName(def->name)))
+ if (!(leasefile = networkDnsmasqLeaseFileNameDefault(def->name)))
goto cleanup;
if (!(customleasefile = networkDnsmasqLeaseFileNameCustom(def->bridge)))
ipdef = (ipdef == ipv6def) ? NULL : ipv6def;
}
- if (nbleases > 0) {
- char *leasefile = networkDnsmasqLeaseFileName(network->def->name);
- if (!leasefile)
- goto cleanup;
- virBufferAsprintf(&configbuf, "dhcp-leasefile=%s\n", leasefile);
- VIR_FREE(leasefile);
+ if (nbleases > 0)
virBufferAsprintf(&configbuf, "dhcp-lease-max=%d\n", nbleases);
- }
/* this is done once per interface */
if (networkBuildDnsmasqHostsList(dctx, dns) < 0)
typedef char *(*networkDnsmasqLeaseFileNameFunc)(const char *netname);
-/* this allows the testsuite to replace the lease filename resolver function */
-extern networkDnsmasqLeaseFileNameFunc networkDnsmasqLeaseFileName;
-
#endif /* __VIR_NETWORK__DRIVER_H */
dhcp-range=192.168.122.2,192.168.122.254
dhcp-no-override
dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
dhcp-lease-max=493
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
bind-dynamic
interface=virbr0
dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
dhcp-lease-max=240
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
no-resolv
dhcp-range=192.168.152.2,192.168.152.254
dhcp-no-override
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/private.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/private.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/private.addnhosts
srv-host=_name._tcp
dhcp-range=192.168.122.2,192.168.122.254
dhcp-no-override
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
srv-host=_name7._tcp.test7.com,test7.example.com,1,0,777
dhcp-range=192.168.122.2,192.168.122.254
dhcp-no-override
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
txt-record=example,example value
dhcp-range=192.168.122.2,192.168.122.254
dhcp-no-override
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254
dhcp-no-override
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
enable-tftp
tftp-root=/var/lib/tftproot
dhcp-boot=pxeboot.img
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/netboot.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/netboot.addnhosts
dhcp-range=192.168.122.2,192.168.122.254
dhcp-no-override
dhcp-boot=pxeboot.img,,10.20.30.40
-dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/netboot.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/netboot.addnhosts
return result;
}
-static char *
-testDnsmasqLeaseFileName(const char *netname)
-{
- char *leasefile;
-
- ignore_value(virAsprintf(&leasefile, "/var/lib/libvirt/dnsmasq/%s.leases",
- netname));
- return leasefile;
-}
-
static int
mymain(void)
{
dnsmasqCapsPtr dhcpv6
= dnsmasqCapsNewFromBuffer("Dnsmasq version 2.64\n--bind-dynamic", DNSMASQ);
- networkDnsmasqLeaseFileName = testDnsmasqLeaseFileName;
-
#define DO_TEST(xname, xcaps) \
do { \
static testInfo info; \