diff options
| author | Rob Norris <rob.norris@klarasystems.com> | 2025-12-17 17:00:47 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2025-12-17 17:00:47 +0000 |
| commit | 2a87929671e6e6919c18f2c25d60f2c73c3d18f4 (patch) | |
| tree | 600baa42cbb669cb10306390955f9f75086177ab /lib/libbe | |
| parent | 1fad49baf390cb52f238e6c352d0bc0893c008c3 (diff) | |
Diffstat (limited to 'lib/libbe')
| -rw-r--r-- | lib/libbe/be.c | 12 | ||||
| -rw-r--r-- | lib/libbe/be.h | 2 | ||||
| -rw-r--r-- | lib/libbe/libbe.3 | 16 |
3 files changed, 28 insertions, 2 deletions
diff --git a/lib/libbe/be.c b/lib/libbe/be.c index 613235d5e908..4a7c2e43b2c1 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -1343,3 +1343,15 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) return (BE_ERR_SUCCESS); } + +int +be_log_history(libbe_handle_t *lbh, const char *message) +{ + int err; + + err = zpool_log_history(lbh->lzh, message); + if (err) + return (set_error(lbh, BE_ERR_UNKNOWN)); + + return (BE_ERR_SUCCESS); +} diff --git a/lib/libbe/be.h b/lib/libbe/be.h index 01ee94fd03ca..d3f47c0604fe 100644 --- a/lib/libbe/be.h +++ b/lib/libbe/be.h @@ -107,6 +107,8 @@ int be_exists(libbe_handle_t *, const char *); int be_export(libbe_handle_t *, const char *, int fd); int be_import(libbe_handle_t *, const char *, int fd); +int be_log_history(libbe_handle_t *, const char *); + #if SOON int be_add_child(libbe_handle_t *, const char *, bool); #endif diff --git a/lib/libbe/libbe.3 b/lib/libbe/libbe.3 index 3b10711dd0f9..4331713e9227 100644 --- a/lib/libbe/libbe.3 +++ b/lib/libbe/libbe.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2025 +.Dd December 11, 2025 .Dt LIBBE 3 .Os .Sh NAME @@ -144,6 +144,9 @@ .Pp .Ft void .Fn be_prop_list_free "nvlist_t *prop_list" +.Pp +.Ft int +.Fn be_log_history "libbe_handle_t *hdl" "const char *message" .Sh DESCRIPTION .Nm interfaces with libzfs to provide a set of functions for various operations @@ -536,6 +539,14 @@ exactly as specified by The .Fn be_prop_list_free function will free the property list. +.Pp +The +.Fn be_log_history +function will log the given +.Fa message +to the zpool history, which can be later retrieved using the +.Xr zpool-history 8 +command. .Sh DIAGNOSTICS Upon error, one of the following values will be returned: .Bl -bullet -offset indent -compact @@ -583,7 +594,8 @@ BE_ERR_UNKNOWN BE_ERR_INVORIGIN .El .Sh SEE ALSO -.Xr bectl 8 +.Xr bectl 8 , +.Xr zpool-history 8 .Sh HISTORY .Xr bectl 8 and |
