git: 127b443124d1 - main - gvinum: Emit deprecation notice upon drive tasting

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 20 Jan 2025 20:29:10 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=127b443124d1e720b246ad381648c436c3d240de

commit 127b443124d1e720b246ad381648c436c3d240de
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-12-12 21:07:26 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-01-20 20:25:33 +0000

    gvinum: Emit deprecation notice upon drive tasting
    
    Reviewed by:    phk, jhb
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D38607
---
 sys/geom/vinum/geom_vinum_events.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/geom/vinum/geom_vinum_events.c b/sys/geom/vinum/geom_vinum_events.c
index e1206a671091..4175a438aa9f 100644
--- a/sys/geom/vinum/geom_vinum_events.c
+++ b/sys/geom/vinum/geom_vinum_events.c
@@ -39,6 +39,8 @@
 #include <geom/vinum/geom_vinum_var.h>
 #include <geom/vinum/geom_vinum.h>
 
+static bool deprecation_printed;
+
 void
 gv_post_event(struct gv_softc *sc, int event, void *arg1, void *arg2,
     intmax_t arg3, intmax_t arg4)
@@ -179,6 +181,13 @@ gv_drive_tasted(struct gv_softc *sc, struct g_provider *pp)
 	gv_setup_objects(sc);
 	gv_set_drive_state(d, GV_DRIVE_UP, 0);
 
+	/* Emit deprecation notice. */
+	if (!deprecation_printed) {
+		gone_in(15, "gvinum volume manager");
+		deprecation_printed = true;
+	}
+	G_VINUM_DEBUG(1, "drive '%s' relies on deprecated gvinum", d->name);
+
 	return;
 
 failed: