]> 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>
Wed, 11 May 2022 01:20:25 +0000 (21:20 -0400)
commit5f6a3a81f63c037a8f67978d08ebb9c7ac2c213f
tree7ffe1250b7025962eb155ace827fe2f9ba3e48d3
parentd6a32773ea4b466413943fb8d7335cf483f7cde8
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

(cherry picked from commit 7f16b501e25b6c792fefc4535e0d1b8363392fe0)
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