[libvirt] [PATCH] leasetime support per <dhcp> and <host>

Daniel P. Berrange berrange at redhat.com
Thu Apr 6 10:17:32 UTC 2017


Sorry, we missed this 2nd patch posting.

FYI, when sending updated versions of patches, we generally recommend to
send them as a new top level thread, with 'PATCH v2' in the subject line,
not as reply  to the v1 patch. We find that makes it less likely to miss
the second version when processing email.

> From d48f957ab78310d864b356b4a25b9a29722ca736 Mon Sep 17 00:00:00 2001
> From: Alberto Ruiz <aruiz at gnome.org>
> Date: Thu, 6 Oct 2016 21:29:40 +0100
> Subject: [PATCH] leasetime support per <dhcp> and <host>
> 
> Support for custom dhcp wide and per host leasetime.
> 
> It is specified as a child tag for <dhcp>:
> <dhcp>
>   <leasetime>24h</leasetime>
>   ...
> </dhcp>
> 
> And as an attribute for <host>:
> <dhcp>
>   <host leasetime="7d" .../>
> </dhcp>
> 
> These are the different notations:
> 
> -1   (infinite/unlimited lease)
> 120  (seconds are the default unit, 120 seconds is the minimum, if less is specified it will use 120)
> 300s (seconds)
> 5m   (minutes)
> 24h  (hours)
> 7d   (days)

What does '0' mean - i guess we're considering '0' to mean the default
dnsmasq lease time for sake of upgrade from previous versions ?

Using this syntax means that applications processing XML need to first
extract the attribute, and then parse it to separate the value from the
unit.

In most other places, we use separate attribute to denote the units.

So I think we'd probably be better doing

 <dhcp>
   <leasetime unit="hours">24</leasetime>
   ...
 </dhcp>
 
and
 
 <dhcp>
   <host leasetime="7" leaseunit="days" .../>
 </dhcp>


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the libvir-list mailing list