
On 04/15/2016 08:18 PM, Alberto Ruiz wrote:
From 112f61ec5cfdc39f7a157825c4209f7bae34c483 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz <aruiz@gnome.org> Date: Wed, 13 Apr 2016 17:00:45 +0100 Subject: [PATCH] network: Add support for dhcp-range lease time in the network XML configuration format and dnsmasq
Also mention the bug in the commit message, just link it like https://bugzilla.redhat.com/show_bug.cgi?id=913446 Needs documentation but that will be dependent on what the final patch looks like, so fine to skip for now. The main questions are: 1) is the XML format fine? <range ... lease='XXX'/>. lease sounds kinda non-specific to me, maybe leasetime or leaseTime. 2) what to use for the input format? right now it's just string passthrough to dnsmasq, which takes a format like XX[s|m|h|d|w], or 'infinite'. Accepting that format kind of sticks us with that for all time, which probably isn't a good precedent. the easy way would probably be to just say the value needs to be in minutes, and maybe -1 == infinite. But that will take a bit more code to adapt that value to the dnsmasq format. CC laining for his thoughts And one tiny comment below:
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 4fb2e2a..449c9ed 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -313,6 +313,10 @@ static void virNetworkIpDefClear(virNetworkIpDefPtr def) { VIR_FREE(def->family); + + while (def->nranges) + VIR_FREE(def->ranges[--def->nranges].lease); + VIR_FREE(def->ranges);
while (def->nhosts) @@ -855,7 +859,6 @@ int virNetworkIpDefNetmask(const virNetworkIpDef *def, VIR_SOCKET_ADDR_FAMILY(&def->address)); }
-
stray whitespace change here - Cole