summaryrefslogtreecommitdiffstats
path: root/sys/geom/stripe
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-05-26 11:36:27 +0000
committerpjd <pjd@FreeBSD.org>2004-05-26 11:36:27 +0000
commit4a04a3b0074cff6df372ea64435cdfaa51dd6835 (patch)
treeeadb9891f67e46eab311aeefbb0b247a60b9b6e2 /sys/geom/stripe
parentff1f6d8a76071de2ae9e0605e4f8f839a95ac0d2 (diff)
downloadFreeBSD-src-4a04a3b0074cff6df372ea64435cdfaa51dd6835.zip
FreeBSD-src-4a04a3b0074cff6df372ea64435cdfaa51dd6835.tar.gz
Dump some more informations:
- device state - list of used providers - total number of disks - number of disks online Prodded by: Alex Deiter <tiamat@komi.mts.ru>
Diffstat (limited to 'sys/geom/stripe')
-rw-r--r--sys/geom/stripe/g_stripe.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c
index 3b596b0..1d87a49 100644
--- a/sys/geom/stripe/g_stripe.c
+++ b/sys/geom/stripe/g_stripe.c
@@ -874,27 +874,37 @@ g_stripe_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
struct g_stripe_softc *sc;
sc = gp->softc;
- if (sc == NULL)
+ if (sc == NULL || pp == NULL)
return;
- if (gp != NULL) {
- sbuf_printf(sb, "%s<id>%u</id>\n", indent, (u_int)sc->sc_id);
- sbuf_printf(sb, "%s<stripesize>%u</stripesize>\n", indent,
- (u_int)sc->sc_stripesize);
- switch (sc->sc_type) {
- case G_STRIPE_TYPE_AUTOMATIC:
- sbuf_printf(sb, "%s<type>%s</type>\n", indent,
- "automatic");
- break;
- case G_STRIPE_TYPE_MANUAL:
- sbuf_printf(sb, "%s<type>%s</type>\n", indent,
- "manual");
- break;
- default:
- sbuf_printf(sb, "%s<type>%s</type>\n", indent,
- "unknown");
- break;
- }
+ sbuf_printf(sb, "%s<id>%u</id>\n", indent, (u_int)sc->sc_id);
+ sbuf_printf(sb, "%s<stripesize>%u</stripesize>\n", indent,
+ (u_int)sc->sc_stripesize);
+ switch (sc->sc_type) {
+ case G_STRIPE_TYPE_AUTOMATIC:
+ sbuf_printf(sb, "%s<type>%s</type>\n", indent, "automatic");
+ break;
+ case G_STRIPE_TYPE_MANUAL:
+ sbuf_printf(sb, "%s<type>%s</type>\n", indent, "manual");
+ break;
+ default:
+ sbuf_printf(sb, "%s<type>%s</type>\n", indent, "unknown");
+ break;
}
+ sbuf_printf(sb, "%s<providers>", indent);
+ LIST_FOREACH(cp, &gp->consumer, consumer) {
+ if (cp->provider == NULL)
+ continue;
+ sbuf_printf(sb, "%s", cp->provider->name);
+ if (LIST_NEXT(cp, consumer) != NULL)
+ sbuf_printf(sb, " ");
+ }
+ sbuf_printf(sb, "</providers>\n");
+ sbuf_printf(sb, "%s<status>total=%u, online=%u</status>\n", indent,
+ sc->sc_ndisks, g_stripe_nvalid(sc));
+ if (pp->error == 0)
+ sbuf_printf(sb, "%s<state>UP</state>\n", indent);
+ else
+ sbuf_printf(sb, "%s<state>DOWN</state>\n", indent);
}
DECLARE_GEOM_CLASS(g_stripe_class, g_stripe);
OpenPOWER on IntegriCloud