diff options
Diffstat (limited to 'sbin/geom/core/geom.c')
-rw-r--r-- | sbin/geom/core/geom.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 496123f08274..2de696ce6a43 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -968,7 +968,7 @@ list_one_geom(struct ggeom *gp) xo_emit("{Tc:Providers}\n"); n = 1; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { - xo_emit("{T:/%u} ", n++); + xo_emit("{T:/%u}. ", n++); xo_open_instance("provider"); list_one_provider(pp, " "); xo_close_instance("provider"); @@ -980,7 +980,7 @@ list_one_geom(struct ggeom *gp) xo_emit("{Tc:Consumers}\n"); n = 1; LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { - xo_emit("{T:/%u} ", n++); + xo_emit("{T:/%u}. ", n++); xo_open_instance("consumer"); list_one_consumer(cp, " "); xo_close_instance("consumer"); @@ -1189,10 +1189,11 @@ status_one_geom(struct ggeom *gp, int script, int name_len, int status_len) gotone = len = 0; xo_open_instance("status"); LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { + if (cp->lg_provider == NULL) + continue; + cstate = status_one_consumer(cp, "state"); csyncr = status_one_consumer(cp, "synchronized"); - if (cstate == NULL && csyncr == NULL) - continue; if (!gotone || script) { if (!gotone) { xo_emit("{:name/%*s} {:status/%*s} ", @@ -1206,14 +1207,17 @@ status_one_geom(struct ggeom *gp, int script, int name_len, int status_len) xo_open_instance("components"); if (cstate != NULL && csyncr != NULL) { - xo_emit("{P:/%*s}{:compontent} ({:state}, {:synchronized})\n", + xo_emit("{P:/%*s}{:component} ({:state}, {:synchronized})\n", len, "", cp->lg_provider->lg_name, cstate, csyncr); } else if (cstate != NULL) { - xo_emit("{P:/%*s}{:compontent} ({:state})\n", + xo_emit("{P:/%*s}{:component} ({:state})\n", len, "", cp->lg_provider->lg_name, cstate); - } else { - xo_emit("{P:/%*s}{:compontent} ({:synchronized})\n", + } else if (csyncr != NULL) { + xo_emit("{P:/%*s}{:component} ({:synchronized})\n", len, "", cp->lg_provider->lg_name, csyncr); + } else { + xo_emit("{P:/%*s}{:component}\n", + len, "", cp->lg_provider->lg_name); } xo_close_instance("components"); gotone = 1; @@ -1224,7 +1228,7 @@ status_one_geom(struct ggeom *gp, int script, int name_len, int status_len) xo_emit("{:name/%*s} {:status/%*s} ", name_len, name, status_len, status); xo_open_list("components"); xo_open_instance("components"); - xo_emit("{P:/%*s}{d:compontent}\n", len, "", "N/A"); + xo_emit("{P:/%*s}{d:component}\n", len, "", "N/A"); xo_close_instance("components"); } xo_close_list("components"); @@ -1258,11 +1262,11 @@ status_one_geom_prs(struct ggeom *gp, int script, int name_len, int status_len) } gotone = len = 0; LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { - cstate = status_one_consumer(cp, "state"); - csyncr = status_one_consumer(cp, "synchronized"); - if (cstate == NULL && csyncr == NULL) + if (cp->lg_provider == NULL) continue; + cstate = status_one_consumer(cp, "state"); + csyncr = status_one_consumer(cp, "synchronized"); if (!gotone || script) { if (!gotone) { xo_emit("{:name/%*s} {:status/%*s} ", @@ -1276,14 +1280,17 @@ status_one_geom_prs(struct ggeom *gp, int script, int name_len, int status_len) xo_open_instance("component"); if (cstate != NULL && csyncr != NULL) { - xo_emit("{P:/%*s}{:compontent} ({:state}, {:synchronized})\n", + xo_emit("{P:/%*s}{:component} ({:state}, {:synchronized})\n", len, "", cp->lg_provider->lg_name, cstate, csyncr); } else if (cstate != NULL) { - xo_emit("{P:/%*s}{:compontent} ({:state})\n", + xo_emit("{P:/%*s}{:component} ({:state})\n", len, "", cp->lg_provider->lg_name, cstate); - } else { - xo_emit("{P:/%*s}{:compontent} ({:synchronized})\n", + } else if (csyncr != NULL) { + xo_emit("{P:/%*s}{:component} ({:synchronized})\n", len, "", cp->lg_provider->lg_name, csyncr); + } else { + xo_emit("{P:/%*s}{:component}\n", + len, "", cp->lg_provider->lg_name); } xo_close_instance("component"); gotone = 1; @@ -1294,7 +1301,7 @@ status_one_geom_prs(struct ggeom *gp, int script, int name_len, int status_len) xo_emit("{:name/%*s} {:status/%*s} ", name_len, name, status_len, status); xo_open_list("components"); xo_open_instance("components"); - xo_emit("{P:/%*s}{d:compontent}\n", len, "", "N/A"); + xo_emit("{P:/%*s}{d:component}\n", len, "", "N/A"); xo_close_instance("components"); } xo_close_list("components"); |