]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
GEOM: Introduce partial confxml API
authorAlexander Motin <mav@FreeBSD.org>
Sat, 12 Mar 2022 16:49:37 +0000 (11:49 -0500)
committerAlexander Motin <mav@FreeBSD.org>
Sat, 12 Mar 2022 16:55:52 +0000 (11:55 -0500)
commit7f16b501e25b6c792fefc4535e0d1b8363392fe0
treedcc495a1a4540e1c95a02c42cffe887707750670
parentdb11c57a6cf3053fb09185975cfbe3729f2fbe44
GEOM: Introduce partial confxml API

Traditionally the GEOM's primary channel of information from kernel to
user-space was confxml, fetched by libgeom through kern.geom.confxml
sysctl.  It is convenient and informative, representing full state of
GEOM in a single XML document.  But problems start to arise on systems
with hundreds of disks, where the full confxml size reaches many
megabytes, taking significant time to first write it and then parse.

This patch introduces alternative solution, allowing to fetch much
smaller XML document, subset of the full confxml, limited to 64KB and
representing only one specified geom and optionally its parents.  It
uses existing GEOM control interface, extended with new "getxml" verb.
In case of any error, such as the buffer overflow, it just transparently
falls back to traditional full confxml.  This patch uses the new API in
user-space GEOM tools where it is possible.

Reviewed by: imp
MFC after: 2 month
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D34529
lib/geom/mirror/geom_mirror.c
lib/geom/part/geom_part.c
lib/libgeom/geom_getxml.c
lib/libgeom/geom_xml2tree.c
lib/libgeom/libgeom.h
sbin/geom/core/geom.c
sys/geom/geom.h
sys/geom/geom_ctl.c
sys/geom/geom_dump.c
sys/geom/geom_int.h