]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virlease: Allow infinite lease expiry time
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Dec 2020 15:09:11 +0000 (16:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Jan 2021 14:33:31 +0000 (15:33 +0100)
commit6f1ae57129f28444d14bd4b6dbcbf4158b95431b
treea4d93c9640c4d2d7005cf228834081e452f825f6
parent003fff38e753d2d7cacaa3afd3f942f938408334
virlease: Allow infinite lease expiry time

When adding a new lease by our leaseshelper then virLeaseNew() is
called. Here, we check for DNSMASQ_LEASE_EXPIRES environment
variable which is the expiration time for the lease. For infinite
lease time the value is zero. However, our code is not prepared
for that and adds "expiry-time" into the JSON file only if lease
expiry time is non-zero. This breaks the assumption that the
"expiry-time" attribute is always present (as can be seen in
virLeaseReadCustomLeaseFile() and virLeasePrintLeases()).

Store "expiry-time" always.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virlease.c