[PATCH 00/10] Fix NSS plugin and net-dhcp-get-leases wrt to infinite leases

Michal Privoznik posted 10 patches 3 years, 4 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1608303776.git.mprivozn@redhat.com
docs/formatnetwork.html.in     | 21 ++++++++-
src/network/bridge_driver.c    | 79 +++++++++++++++++-----------------
src/network/leaseshelper.c     |  2 +
src/util/virlease.c            | 33 +++++++-------
tests/nssdata/virbr0.status    |  7 +++
tests/nsstest.c                |  2 +-
tools/nss/libvirt_nss_leases.c |  4 +-
7 files changed, 87 insertions(+), 61 deletions(-)
[PATCH 00/10] Fix NSS plugin and net-dhcp-get-leases wrt to infinite leases
Posted by Michal Privoznik 3 years, 4 months ago
Some things are broken when using leases that don't expire. We don't
store "expiry-time" in corresponding $brname.status file which sets off
a spiral and we get errors from other places which expect it to be there
always. These patches make sure that the attribute is always there. I've
also implemented another approach, which puts "expiry-time" into the
file only if not infinite and fixed the other places which expect it:

  https://gitlab.com/MichalPrivoznik/libvirt/-/commits/leases_docs/

but I like this version more.

Michal Prívozník (10):
  docs: Document ability to configure lease time
  leaseshelper: Report errors on failure
  virlease: Rework virLeaseReadCustomLeaseFile()
  virlease: Use virTrimSpaces() instead of open coded alternative
  virlease: Allow infinite lease expiry time
  network: Drop @custom_lease_file_len variable from
    networkGetDHCPLeases()
  networkGetDHCPLeases: Use VIR_APPEND_ELEMENT() instead of
    VIR_INSERT_ELEMENT()
  network: Rework networkGetDHCPLeases()
  networkGetDHCPLeases: Handle leases with infinite expiry time
  nss: handle leases with infinite expiry time

 docs/formatnetwork.html.in     | 21 ++++++++-
 src/network/bridge_driver.c    | 79 +++++++++++++++++-----------------
 src/network/leaseshelper.c     |  2 +
 src/util/virlease.c            | 33 +++++++-------
 tests/nssdata/virbr0.status    |  7 +++
 tests/nsstest.c                |  2 +-
 tools/nss/libvirt_nss_leases.c |  4 +-
 7 files changed, 87 insertions(+), 61 deletions(-)

-- 
2.26.2

Re: [PATCH 00/10] Fix NSS plugin and net-dhcp-get-leases wrt to infinite leases
Posted by Daniel P. Berrangé 3 years, 3 months ago
On Fri, Dec 18, 2020 at 04:09:06PM +0100, Michal Privoznik wrote:
> Some things are broken when using leases that don't expire. We don't
> store "expiry-time" in corresponding $brname.status file which sets off
> a spiral and we get errors from other places which expect it to be there
> always. These patches make sure that the attribute is always there. I've
> also implemented another approach, which puts "expiry-time" into the
> file only if not infinite and fixed the other places which expect it:
> 
>   https://gitlab.com/MichalPrivoznik/libvirt/-/commits/leases_docs/
> 
> but I like this version more.
> 
> Michal Prívozník (10):
>   docs: Document ability to configure lease time
>   leaseshelper: Report errors on failure
>   virlease: Rework virLeaseReadCustomLeaseFile()
>   virlease: Use virTrimSpaces() instead of open coded alternative
>   virlease: Allow infinite lease expiry time
>   network: Drop @custom_lease_file_len variable from
>     networkGetDHCPLeases()
>   networkGetDHCPLeases: Use VIR_APPEND_ELEMENT() instead of
>     VIR_INSERT_ELEMENT()
>   network: Rework networkGetDHCPLeases()
>   networkGetDHCPLeases: Handle leases with infinite expiry time
>   nss: handle leases with infinite expiry time
> 
>  docs/formatnetwork.html.in     | 21 ++++++++-
>  src/network/bridge_driver.c    | 79 +++++++++++++++++-----------------
>  src/network/leaseshelper.c     |  2 +
>  src/util/virlease.c            | 33 +++++++-------
>  tests/nssdata/virbr0.status    |  7 +++
>  tests/nsstest.c                |  2 +-
>  tools/nss/libvirt_nss_leases.c |  4 +-
>  7 files changed, 87 insertions(+), 61 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|