Index: class/concat/gconcat.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/concat/gconcat.8,v retrieving revision 1.11.2.2 diff -u -p -r1.11.2.2 gconcat.8 --- class/concat/gconcat.8 20 Jan 2005 21:49:51 -0000 1.11.2.2 +++ class/concat/gconcat.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -58,13 +58,12 @@ .Ar prov ... .Nm .Cm list -.Op Ar name ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm @@ -117,15 +116,17 @@ Clear metadata on the given devices. .It Cm dump Dump metadata stored on the given devices. .It Cm list -List all or the given currently configured devices. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_concat.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_concat.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options: @@ -153,6 +154,8 @@ This can be set to a number between 0 an If set to 0 minimal debug information is printed, and if set to 3 the maximum amount of debug information is printed. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to configure four disks for automatic concatenation, create a file system on it, and mount it: @@ -165,8 +168,6 @@ umount /mnt gconcat stop data gconcat unload .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr loader.conf 5 , Index: class/concat/geom_concat.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/concat/geom_concat.c,v retrieving revision 1.5.2.2 diff -u -p -r1.5.2.2 geom_concat.c --- class/concat/geom_concat.c 1 Mar 2005 14:22:29 -0000 1.5.2.2 +++ class/concat/geom_concat.c 21 Mar 2005 16:16:07 -0000 @@ -51,46 +51,41 @@ static void concat_dump(struct gctl_req static void concat_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, concat_main, G_NULL_OPTS }, - { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS }, + { "clear", G_FLAG_VERBOSE, concat_main, G_NULL_OPTS, + "[-v] prov ..." + }, + { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS, + "[-v] name prov prov ..." + }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." + }, + { "dump", 0, concat_main, G_NULL_OPTS, + "prov ..." }, - { "dump", 0, concat_main, G_NULL_OPTS }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, concat_main, { { 'h', "hardcode", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-hv] name prov prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." }, G_CMD_SENTINEL }; static int verbose = 0; - -void usage(const char *name); -void -usage(const char *name) -{ - - fprintf(stderr, "usage: %s create [-v] name prov prov ...\n", name); - fprintf(stderr, " %s destroy [-fv] name ...\n", name); - fprintf(stderr, " %s label [-hv] name prov prov ...\n", name); - fprintf(stderr, " %s stop [-fv] name ...\n", name); - fprintf(stderr, " %s clear [-v] prov ...\n", name); - fprintf(stderr, " %s dump prov ...\n", name); -} - static void concat_main(struct gctl_req *req, unsigned flags) { Index: class/label/geom_label.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/label/geom_label.c,v retrieving revision 1.3.2.2 diff -u -p -r1.3.2.2 geom_label.c --- class/label/geom_label.c 1 Mar 2005 14:22:30 -0000 1.3.2.2 +++ class/label/geom_label.c 21 Mar 2005 16:16:07 -0000 @@ -50,41 +50,37 @@ static void label_dump(struct gctl_req * static void label_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, label_main, G_NULL_OPTS }, - { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS }, + { "clear", G_FLAG_VERBOSE, label_main, G_NULL_OPTS, + "[-v] dev ..." + }, + { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS, + "[-v] name dev" + }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." + }, + { "dump", 0, label_main, G_NULL_OPTS, + "dev ..." + }, + { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, label_main, G_NULL_OPTS, + "[-v] name dev" }, - { "dump", 0, label_main, G_NULL_OPTS }, - { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, label_main, G_NULL_OPTS }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." }, G_CMD_SENTINEL }; static int verbose = 0; - -void usage(const char *name); -void -usage(const char *name) -{ - - fprintf(stderr, "usage: %s create [-v] name dev\n", name); - fprintf(stderr, " %s destroy [-fv] name ...\n", name); - fprintf(stderr, " %s label [-v] name dev\n", name); - fprintf(stderr, " %s stop [-fv] name ...\n", name); - fprintf(stderr, " %s clear [-v] dev ...\n", name); - fprintf(stderr, " %s dump dev ...\n", name); -} - static void label_main(struct gctl_req *req, unsigned flags) { Index: class/label/glabel.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/label/glabel.8,v retrieving revision 1.6.2.2 diff -u -p -r1.6.2.2 glabel.8 --- class/label/glabel.8 20 Jan 2005 21:49:51 -0000 1.6.2.2 +++ class/label/glabel.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -58,13 +58,12 @@ .Ar dev ... .Nm .Cm list -.Op Ar prov ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm @@ -144,15 +143,17 @@ Clear metadata on the given devices. .It Cm dump Dump metadata stored on the given devices. .It Cm list -List all currently configured devices, or list the given devices. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_label.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_label.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options: @@ -178,6 +179,8 @@ This can be set to a number between 0 an If set to 0 minimal debug information is printed, and if set to 2 the maximum amount of debug information is printed. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to set up a label for disk .Dq Li da2 , @@ -197,8 +200,6 @@ The next example shows how to set up a l tunefs -L data /dev/da4s1a mount /dev/ufs/data /mnt/data .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr loader.conf 5 , Index: class/mirror/geom_mirror.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/mirror/geom_mirror.c,v retrieving revision 1.3.2.6 diff -u -p -r1.3.2.6 geom_mirror.c --- class/mirror/geom_mirror.c 1 Mar 2005 14:22:30 -0000 1.3.2.6 +++ class/mirror/geom_mirror.c 21 Mar 2005 16:16:07 -0000 @@ -56,8 +56,12 @@ static void mirror_dump(struct gctl_req static void mirror_label(struct gctl_req *req); struct g_command class_commands[] = { - { "activate", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS }, - { "clear", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS }, + { "activate", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "clear", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, + "[-v] prov ..." + }, { "configure", G_FLAG_VERBOSE, NULL, { { 'a', "autosync", NULL, G_TYPE_NONE }, @@ -67,11 +71,18 @@ struct g_command class_commands[] = { { 'n', "noautosync", NULL, G_TYPE_NONE }, { 's', "slice", &configure_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-adhnv] [-b balance] [-s slice] name" + }, + { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "dump", 0, mirror_main, G_NULL_OPTS, + "prov ..." + }, + { "forget", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "name ..." }, - { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS }, - { "dump", 0, mirror_main, G_NULL_OPTS }, - { "forget", G_FLAG_VERBOSE, NULL, G_NULL_OPTS }, { "label", G_FLAG_VERBOSE, mirror_main, { { 'b', "balance", label_balance, G_TYPE_STRING }, @@ -79,7 +90,8 @@ struct g_command class_commands[] = { { 'n', "noautosync", NULL, G_TYPE_NONE }, { 's', "slice", &label_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-hnv] [-b balance] [-s slice] name prov ..." }, { "insert", G_FLAG_VERBOSE, NULL, { @@ -87,40 +99,27 @@ struct g_command class_commands[] = { { 'i', "inactive", NULL, G_TYPE_NONE }, { 'p', "priority", &insert_priority, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-hiv] [-p priority] name prov ..." + }, + { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov ..." + }, + { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov ..." }, - { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS }, - { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." }, G_CMD_SENTINEL }; static int verbose = 0; -void usage(const char *); -void -usage(const char *comm) -{ - fprintf(stderr, - "usage: %s label [-hnv] [-b balance] [-s slice] name prov ...\n" - " %s clear [-v] prov ...\n" - " %s dump prov ...\n" - " %s configure [-adhnv] [-b balance] [-s slice] name\n" - " %s rebuild [-v] name prov ...\n" - " %s insert [-hiv] [-p priority] name prov ...\n" - " %s remove [-v] name prov ...\n" - " %s activate [-v] name prov ...\n" - " %s deactivate [-v] name prov ...\n" - " %s forget name ...\n" - " %s stop [-fv] name ...\n", - comm, comm, comm, comm, comm, comm, comm, comm, comm, comm, comm); -} - static void mirror_main(struct gctl_req *req, unsigned flags) { Index: class/mirror/gmirror.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/mirror/gmirror.8,v retrieving revision 1.4.2.6 diff -u -p -r1.4.2.6 gmirror.8 --- class/mirror/gmirror.8 26 Feb 2005 05:16:55 -0000 1.4.2.6 +++ class/mirror/gmirror.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -84,13 +84,12 @@ .Ar name ... .Nm .Cm list -.Op Ar name ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm @@ -203,16 +202,17 @@ Additional options include: Stop the given mirror even if it is opened. .El .It Cm list -List every currently configured device; if a list of devices is passed as a -parameter then only those devices will be shown. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_mirror.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_mirror.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options include: @@ -220,6 +220,8 @@ Additional options include: .It Fl v Be more verbose. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES Use 3 disks to setup a mirror. Choose split balance algorithm, split only @@ -268,8 +270,6 @@ gmirror deactivate data da1 dd if=/dev/da1 of=/backup/data.img bs=1m gmirror activate data da1 .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , Index: class/nop/geom_nop.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/nop/geom_nop.c,v retrieving revision 1.4.2.1 diff -u -p -r1.4.2.1 geom_nop.c --- class/nop/geom_nop.c 20 Jan 2005 21:49:51 -0000 1.4.2.1 +++ class/nop/geom_nop.c 21 Mar 2005 16:16:07 -0000 @@ -51,29 +51,22 @@ struct g_command class_commands[] = { { 's', "size", &size, G_TYPE_NUMBER }, { 'S', "secsize", &secsize, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-v] [-f failprob] [-o offset] [-s size] [-S secsize] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { { 'f', "failprob", &failprob, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-v] [-f failprob] prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] prov ..." }, G_CMD_SENTINEL }; - -void usage(const char *name); -void -usage(const char *name) -{ - - fprintf(stderr, "usage: %s create [-v] [-f failprob] [-o offset] [-s size] [-S secsize] dev ...\n", name); - fprintf(stderr, " %s configure [-v] [-f failprob] prov ...\n", name); - fprintf(stderr, " %s destroy [-fv] prov ...\n", name); -} Index: class/nop/gnop.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/nop/gnop.8,v retrieving revision 1.12.2.2 diff -u -p -r1.12.2.2 gnop.8 --- class/nop/gnop.8 20 Jan 2005 21:49:51 -0000 1.12.2.2 +++ class/nop/gnop.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -50,13 +50,12 @@ .Ar prov ... .Nm .Cm list -.Op Ar prov ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm @@ -86,15 +85,17 @@ will be loaded if it is not loaded alrea .It Cm destroy Turn off the given transparent providers. .It Cm list -List all or the given currently configured providers. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_nop.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_nop.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options: @@ -128,6 +129,8 @@ This can be set to a number between 0 an If set to 0 minimal debug information is printed, and if set to 2 the maximum amount of debug information is printed. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to create a transparent provider for disk .Pa /dev/da0 @@ -136,8 +139,6 @@ with 50% failure probability, and how to gnop create -v -f 50 da0 gnop destroy -v da0.nop .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 Index: class/raid3/geom_raid3.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/raid3/geom_raid3.c,v retrieving revision 1.1.2.5 diff -u -p -r1.1.2.5 geom_raid3.c --- class/raid3/geom_raid3.c 1 Mar 2005 14:22:30 -0000 1.1.2.5 +++ class/raid3/geom_raid3.c 21 Mar 2005 16:16:07 -0000 @@ -51,7 +51,9 @@ static void raid3_dump(struct gctl_req * static void raid3_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, raid3_main, G_NULL_OPTS }, + { "clear", G_FLAG_VERBOSE, raid3_main, G_NULL_OPTS, + "[-v] prov ..." + }, { "configure", G_FLAG_VERBOSE, NULL, { { 'a', "autosync", NULL, G_TYPE_NONE }, @@ -63,15 +65,19 @@ struct g_command class_commands[] = { { 'w', "verify", NULL, G_TYPE_NONE }, { 'W', "noverify", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-adhnrRvwW] name" + }, + { "dump", 0, raid3_main, G_NULL_OPTS, + "prov ..." }, - { "dump", 0, raid3_main, G_NULL_OPTS }, { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_NONE }, { 'n', "number", NULL, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-hv] <-n number> name prov" }, { "label", G_FLAG_VERBOSE, raid3_main, { @@ -80,42 +86,31 @@ struct g_command class_commands[] = { { 'r', "round_robin", NULL, G_TYPE_NONE }, { 'w', "verify", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-hnrvw] name prov prov prov ..." + }, + { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" }, - { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS }, { "remove", G_FLAG_VERBOSE, NULL, { { 'n', "number", NULL, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-v] <-n number> name" }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." }, G_CMD_SENTINEL }; static int verbose = 0; -void usage(const char *); -void -usage(const char *comm) -{ - fprintf(stderr, - "usage: %s label [-hnrvw] name prov prov prov ...\n" - " %s clear [-v] prov ...\n" - " %s dump prov ...\n" - " %s configure [-adhnrRvwW] name\n" - " %s rebuild [-v] name prov\n" - " %s insert [-hv] <-n number> name prov\n" - " %s remove [-v] <-n number> name\n" - " %s stop [-fv] name ...\n", - comm, comm, comm, comm, comm, comm, comm, comm); -} - static void raid3_main(struct gctl_req *req, unsigned flags) { Index: class/raid3/graid3.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/raid3/graid3.8,v retrieving revision 1.4.2.3 diff -u -p -r1.4.2.3 graid3.8 --- class/raid3/graid3.8 20 Jan 2005 21:49:52 -0000 1.4.2.3 +++ class/raid3/graid3.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -66,13 +66,12 @@ .Ar name ... .Nm .Cm list -.Op Ar name ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm @@ -174,16 +173,17 @@ Additional options include: Stop the given array even if it is opened. .El .It Cm list -List every currently configured device; if a list of devices is passed as a -parameter then only those devices will be shown. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_raid3.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_raid3.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options include: @@ -191,6 +191,8 @@ Additional options include: .It Fl v Be more verbose. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES Use 3 disks to setup a RAID3 array (with the round-robin reading feature). Create a file system, mount it, then unmount it and stop device: @@ -217,8 +219,6 @@ Replace one data disk with a brand new o graid3 remove -n 0 data graid3 insert -n 0 data da5 .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , Index: class/shsec/geom_shsec.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/shsec/geom_shsec.c,v retrieving revision 1.4.2.1 diff -u -p -r1.4.2.1 geom_shsec.c --- class/shsec/geom_shsec.c 1 Mar 2005 13:17:30 -0000 1.4.2.1 +++ class/shsec/geom_shsec.c 21 Mar 2005 16:16:07 -0000 @@ -52,36 +52,31 @@ static void shsec_dump(struct gctl_req * static void shsec_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, shsec_main, G_NULL_OPTS }, - { "dump", 0, shsec_main, G_NULL_OPTS }, + { "clear", G_FLAG_VERBOSE, shsec_main, G_NULL_OPTS, + "clear [-v] prov ..." + }, + { "dump", 0, shsec_main, G_NULL_OPTS, + "dump prov ..." + }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, shsec_main, { { 'h', "hardcode", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-hv] name prov prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." }, G_CMD_SENTINEL }; static int verbose = 0; -void usage(const char *name); -void -usage(const char *name) -{ - - fprintf(stderr, "usage: %s label [-hv] name prov prov ...\n", name); - fprintf(stderr, " %s stop [-fv] name ...\n", name); - fprintf(stderr, " %s clear [-v] prov ...\n", name); - fprintf(stderr, " %s dump prov ...\n", name); -} - static void shsec_main(struct gctl_req *req, unsigned flags) { Index: class/shsec/gshsec.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/shsec/gshsec.8,v retrieving revision 1.6.2.1 diff -u -p -r1.6.2.1 gshsec.8 --- class/shsec/gshsec.8 1 Mar 2005 13:17:30 -0000 1.6.2.1 +++ class/shsec/gshsec.8 21 Mar 2005 16:16:07 -0000 @@ -49,17 +49,16 @@ .Ar prov ... .Nm .Cm list -.Op Ar name ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm -utility is used for setting up a device which contains shared secret. +utility is used for setting up a device which contains a shared secret. The secret is shared between the given providers. To collect the secret, all providers are needed. If one of the components is missing, there is no way to get any useful data from @@ -71,7 +70,7 @@ indicates an action to be performed: .It Cm label Set up a shared secret device from the given components with the specified .Ar name . -Metadata are stored in every component's last sector. +Metadata are stored in the last sector of every component. .It Cm stop Turn off an existing shared secret device by its .Ar name . @@ -81,15 +80,17 @@ Clear metadata on the given providers. .It Cm dump Dump metadata stored on the given providers. .It Cm list -List all or the given currently configured shared secret devices. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_shsec.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_shsec.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options: @@ -101,20 +102,20 @@ Hardcode providers' names in metadata. .It Fl v Be more verbose. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES -The following example shows how to created a shared secret device. -Secret will be split between a slice on the local disk and a USB Pen drive. +The following example shows how to create a shared secret device. +The secret will be split between a slice on a local disk and a USB Pen drive. .Bd -literal -offset indent gshsec label -v secret /dev/ad0s1 /dev/da0 newfs /dev/shsec/secret .Ed .Pp -From now on, when USB Pen drive will be inserted, it will be automatically -detected and connected making secret available via +From now on, when the USB Pen drive is inserted, it will be automatically +detected and connected, making the secret available via the .Pa /dev/shsec/secret device. -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr gbde 8 , Index: class/stripe/geom_stripe.c =================================================================== RCS file: /usr/repo/src/sbin/geom/class/stripe/geom_stripe.c,v retrieving revision 1.6.2.4 diff -u -p -r1.6.2.4 geom_stripe.c --- class/stripe/geom_stripe.c 1 Mar 2005 14:22:30 -0000 1.6.2.4 +++ class/stripe/geom_stripe.c 21 Mar 2005 16:16:07 -0000 @@ -54,51 +54,46 @@ static void stripe_dump(struct gctl_req static void stripe_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, stripe_main, G_NULL_OPTS }, + { "clear", G_FLAG_VERBOSE, stripe_main, G_NULL_OPTS, + "[-v] prov ..." + }, { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { { 's', "stripesize", &stripesize, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-hv] [-s stripesize] name prov prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." + }, + { "dump", 0, stripe_main, G_NULL_OPTS, + "dump prov ..." }, - { "dump", 0, stripe_main, G_NULL_OPTS }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, stripe_main, { { 'h', "hardcode", NULL, G_TYPE_NONE }, { 's', "stripesize", &stripesize, G_TYPE_NUMBER }, G_OPT_SENTINEL - } + }, + "[-hv] [-s stripesize] name prov prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_NONE }, G_OPT_SENTINEL - } + }, + "[-fv] name ..." }, G_CMD_SENTINEL }; static int verbose = 0; -void usage(const char *name); -void -usage(const char *name) -{ - - fprintf(stderr, "usage: %s create [-hv] [-s stripesize] name prov prov ...\n", name); - fprintf(stderr, " %s destroy [-fv] name ...\n", name); - fprintf(stderr, " %s label [-hv] [-s stripesize] name prov prov ...\n", name); - fprintf(stderr, " %s stop [-fv] name ...\n", name); - fprintf(stderr, " %s clear [-v] prov ...\n", name); - fprintf(stderr, " %s dump prov ...\n", name); -} - static void stripe_main(struct gctl_req *req, unsigned flags) { Index: class/stripe/gstripe.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/class/stripe/gstripe.8,v retrieving revision 1.15.2.3 diff -u -p -r1.15.2.3 gstripe.8 --- class/stripe/gstripe.8 20 Jan 2005 21:49:52 -0000 1.15.2.3 +++ class/stripe/gstripe.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -60,13 +60,12 @@ .Ar prov ... .Nm .Cm list -.Op Ar name ... +.Nm +.Cm status .Nm .Cm load -.Op Fl v .Nm .Cm unload -.Op Fl v .Sh DESCRIPTION The .Nm @@ -121,15 +120,17 @@ Clear metadata on the given devices. .It Cm dump Dump metadata stored on the given devices. .It Cm list -List all or the given currently configured devices. +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . .It Cm load -Load -.Pa geom_stripe.ko -kernel module. +See +.Xr geom 8 . .It Cm unload -Unload -.Pa geom_stripe.ko -kernel module. +See +.Xr geom 8 . .El .Pp Additional options: @@ -190,6 +191,8 @@ If this value is large, you should consi .Va kern.geom.stripe.maxmem value. .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to set up a striped device from four disks with a 4 KB stripe size for automatic configuration, @@ -204,8 +207,6 @@ umount /mnt gstripe stop data gstripe unload .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh COMPATIBILITY The .Nm Index: core/geom.8 =================================================================== RCS file: /usr/repo/src/sbin/geom/core/geom.8,v retrieving revision 1.4.2.4 diff -u -p -r1.4.2.4 geom.8 --- core/geom.8 1 Mar 2005 13:39:37 -0000 1.4.2.4 +++ core/geom.8 21 Mar 2005 16:16:07 -0000 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,8 +33,24 @@ .Sh SYNOPSIS .Nm .Ar class -.Ar command -.Op Ar options +.Cm help +.Nm +.Ar class +.Cm list +.Op Ar name ... +.Nm +.Ar class +.Cm status +.Op Fl s +.Op Ar name ... +.Nm +.Ar class +.Cm load +.Op Fl v +.Nm +.Ar class +.Cm unload +.Op Fl v .Sh DESCRIPTION The .Nm @@ -46,13 +62,23 @@ which can be used for existing .Xr geom 8 unaware classes. Here is the list of standard commands: -.Bl -tag -width ".Cm unload" +.Bl -tag -width ".Cm status" .It Cm help List all available commands for the given class. .It Cm list Print detailed information (within the given class) about all geoms (if no additional arguments were specified) or the given geoms. This command is only available if the given class exists in the kernel. +.It Cm status +Print general information (within the given class) about all geoms +(if no additional arguments were specified) or the given geoms. +This command is only available if the given class exists in the kernel. +.Pp +Additional options include: +.Bl -tag -width ".Fl s" +.It Fl s +Produce script-friendly output. +.El .It Cm load Load the kernel module that implements the given class. This command is only available if the class does not yet exist in the kernel and @@ -104,6 +130,8 @@ The following environment variables affe Specifies the path where shared libraries are stored instead of .Pa /lib/geom/ . .El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to set up a stripe on three disks for automatic configuration: @@ -122,8 +150,6 @@ Unload a kernel module which implements .Bd -literal -offset indent geom md unload .Ed -.Sh DIAGNOSTICS -Exit status is 0 on success, and 1 if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr gconcat 8 , Index: core/geom.c =================================================================== RCS file: /usr/repo/src/sbin/geom/core/geom.c,v retrieving revision 1.6.2.4 diff -u -p -r1.6.2.4 geom.c --- core/geom.c 1 Mar 2005 13:39:37 -0000 1.6.2.4 +++ core/geom.c 21 Mar 2005 16:16:07 -0000 @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004 Pawel Jakub Dawidek + * Copyright (c) 2004-2005 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,6 @@ static char comm[MAXPATHLEN], *class_nam static uint32_t *version = NULL; static int verbose = 0; static struct g_command *class_commands = NULL; -static void (*usage)(const char *name); #define GEOM_CLASS_CMDS 0x01 #define GEOM_STD_CMDS 0x02 @@ -65,71 +64,80 @@ static int std_available(const char *nam static void std_help(struct gctl_req *req, unsigned flags); static void std_list(struct gctl_req *req, unsigned flags); +static void std_status(struct gctl_req *req, unsigned flags); static void std_load(struct gctl_req *req, unsigned flags); static void std_unload(struct gctl_req *req, unsigned flags); struct g_command std_commands[] = { - { "help", 0, std_help, G_NULL_OPTS }, - { "list", 0, std_list, G_NULL_OPTS }, - { "load", G_FLAG_VERBOSE | G_FLAG_LOADKLD, std_load, G_NULL_OPTS }, - { "unload", G_FLAG_VERBOSE, std_unload, G_NULL_OPTS }, + { "help", 0, std_help, G_NULL_OPTS, NULL }, + { "list", 0, std_list, G_NULL_OPTS, + "[name ...]" + }, + { "status", 0, std_status, + { + { 's', "script", NULL, G_TYPE_NONE }, + G_OPT_SENTINEL + }, + "[-s] [name ...]" + }, + { "load", G_FLAG_VERBOSE | G_FLAG_LOADKLD, std_load, G_NULL_OPTS, NULL }, + { "unload", G_FLAG_VERBOSE, std_unload, G_NULL_OPTS, NULL }, G_CMD_SENTINEL }; static void -std_usage(const char *name) +usage_command(struct g_command *cmd, const char *prefix) { - struct g_command *cmd; struct g_option *opt; - unsigned i, j; + unsigned i; + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); + if (cmd->gc_usage != NULL) { + fprintf(stderr, " %s\n", cmd->gc_usage); + return; + } + if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) + fprintf(stderr, " [-v]"); for (i = 0; ; i++) { - cmd = &class_commands[i]; - if (cmd->gc_name == NULL) + opt = &cmd->gc_options[i]; + if (opt->go_name == NULL) break; - fprintf(stderr, "%s %s %s %s", i == 0 ? "usage:" : " ", - name, class_name, cmd->gc_name); - if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) - fprintf(stderr, " [-v]"); - for (j = 0; ; j++) { - opt = &cmd->gc_options[j]; - if (opt->go_name == NULL) - break; - if (opt->go_val != NULL || opt->go_type == G_TYPE_NONE) - fprintf(stderr, " ["); - else - fprintf(stderr, " "); - fprintf(stderr, "-%c", opt->go_char); - if (opt->go_type != G_TYPE_NONE) - fprintf(stderr, " %s", opt->go_name); - if (opt->go_val != NULL || opt->go_type == G_TYPE_NONE) - fprintf(stderr, "]"); - } - fprintf(stderr, " ...\n"); + if (opt->go_val != NULL || opt->go_type == G_TYPE_NONE) + fprintf(stderr, " ["); + else + fprintf(stderr, " "); + fprintf(stderr, "-%c", opt->go_char); + if (opt->go_type != G_TYPE_NONE) + fprintf(stderr, " %s", opt->go_name); + if (opt->go_val != NULL || opt->go_type == G_TYPE_NONE) + fprintf(stderr, "]"); } - exit(EXIT_FAILURE); + fprintf(stderr, "\n"); } static void -geom_usage(void) +usage(void) { if (class_name == NULL) { errx(EXIT_FAILURE, "usage: %s [options]", "geom"); } else { + struct g_command *cmd; const char *prefix; unsigned i; - if (usage == NULL) - prefix = "usage:"; - else { - usage(comm); - prefix = " "; + prefix = "usage:"; + if (class_commands != NULL) { + for (i = 0; ; i++) { + cmd = &class_commands[i]; + if (cmd->gc_name == NULL) + break; + usage_command(cmd, prefix); + prefix = " "; + } } for (i = 0; ; i++) { - struct g_command *cmd; - cmd = &std_commands[i]; if (cmd->gc_name == NULL) break; @@ -140,10 +148,7 @@ geom_usage(void) */ if (find_command(cmd->gc_name, GEOM_CLASS_CMDS) != NULL) continue; - fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); - if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) - fprintf(stderr, " [-v]"); - fprintf(stderr, "\n"); + usage_command(cmd, prefix); prefix = " "; } exit(EXIT_FAILURE); @@ -280,11 +285,11 @@ parse_arguments(struct g_command *cmd, s /* Options passed to kernel. */ opt = find_option(cmd, ch); if (opt == NULL) - geom_usage(); + usage(); if (G_OPT_ISDONE(opt)) { fprintf(stderr, "Flag '%c' specified twice.\n", opt->go_char); - geom_usage(); + usage(); } G_OPT_DONE(opt); @@ -313,7 +318,7 @@ parse_arguments(struct g_command *cmd, s if (opt->go_val == NULL) { fprintf(stderr, "Flag '%c' not specified.\n", opt->go_char); - geom_usage(); + usage(); } else { if (opt->go_type == G_TYPE_NUMBER) { gctl_ro_param(req, opt->go_name, @@ -402,7 +407,7 @@ run_command(int argc, char *argv[]) cmd = find_command(argv[0], GEOM_STD_CMDS); if (cmd == NULL) { fprintf(stderr, "Unknown command: %s\n", argv[0]); - geom_usage(); + usage(); } if (!std_available(cmd->gc_name)) { fprintf(stderr, "Command '%s' not available.\n", @@ -504,9 +509,6 @@ load_library(void) dlclose(dlh); exit(EXIT_FAILURE); } - usage = dlsym(dlh, "usage"); - if (usage == NULL) - usage = std_usage; } /* @@ -517,6 +519,9 @@ set_class_name(void) { char *s1, *s2; + s1 = class_name; + for (; *s1 != '\0'; s1++) + *s1 = tolower(*s1); gclass_name = malloc(strlen(class_name)); if (gclass_name == NULL) errx(EXIT_FAILURE, "No memory"); @@ -534,11 +539,11 @@ get_class(int *argc, char ***argv) snprintf(comm, sizeof(comm), "%s", basename((*argv)[0])); if (strcmp(comm, "geom") == 0) { if (*argc < 2) - geom_usage(); + usage(); else if (*argc == 2) { if (strcmp((*argv)[1], "-h") == 0 || strcmp((*argv)[1], "help") == 0) { - geom_usage(); + usage(); } } strlcatf(comm, sizeof(comm), " %s", (*argv)[1]); @@ -555,7 +560,7 @@ get_class(int *argc, char ***argv) set_class_name(); load_library(); if (*argc < 1) - geom_usage(); + usage(); } int @@ -594,7 +599,7 @@ find_geom(struct gclass *classp, const c } static void -show_one_provider(struct gprovider *pp, const char *prefix) +list_one_provider(struct gprovider *pp, const char *prefix) { struct gconfig *conf; char buf[5]; @@ -612,7 +617,7 @@ show_one_provider(struct gprovider *pp, } static void -show_one_consumer(struct gconsumer *cp, const char *prefix) +list_one_consumer(struct gconsumer *cp, const char *prefix) { struct gprovider *pp; struct gconfig *conf; @@ -637,7 +642,7 @@ show_one_consumer(struct gconsumer *cp, } static void -show_one_geom(struct ggeom *gp) +list_one_geom(struct ggeom *gp) { struct gprovider *pp; struct gconsumer *cp; @@ -653,7 +658,7 @@ show_one_geom(struct ggeom *gp) n = 1; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { printf("%u. ", n++); - show_one_provider(pp, " "); + list_one_provider(pp, " "); } } if (!LIST_EMPTY(&gp->lg_consumer)) { @@ -661,7 +666,7 @@ show_one_geom(struct ggeom *gp) n = 1; LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { printf("%u. ", n++); - show_one_consumer(cp, " "); + list_one_consumer(cp, " "); } } printf("\n"); @@ -671,7 +676,7 @@ static void std_help(struct gctl_req *req __unused, unsigned flags __unused) { - geom_usage(); + usage(); } static int @@ -730,15 +735,208 @@ std_list(struct gctl_req *req, unsigned assert(name != NULL); gp = find_geom(classp, name); if (gp != NULL) - show_one_geom(gp); + list_one_geom(gp); else fprintf(stderr, "No such geom: %s.\n", name); } } else { LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { - show_one_geom(gp); + if (LIST_EMPTY(&gp->lg_provider)) + continue; + list_one_geom(gp); + } + } + geom_deletetree(&mesh); +} + +static int +std_status_available(void) +{ + + /* 'status' command is available when 'list' command is. */ + return (std_list_available()); +} + +static void +status_update_len(struct ggeom *gp, int *name_len, int *status_len) +{ + struct gprovider *pp; + struct gconfig *conf; + int len; + + assert(gp != NULL); + assert(name_len != NULL); + assert(status_len != NULL); + + pp = LIST_FIRST(&gp->lg_provider); + if (pp != NULL) + len = strlen(pp->lg_name); + else + len = strlen(gp->lg_name); + if (*name_len < len) + *name_len = len; + LIST_FOREACH(conf, &gp->lg_config, lg_config) { + if (strcasecmp(conf->lg_name, "state") == 0) { + len = strlen(conf->lg_val); + if (*status_len < len) + *status_len = len; + } + } +} + +static char * +status_one_consumer(struct gconsumer *cp) +{ + static char buf[256]; + struct gprovider *pp; + struct gconfig *conf; + + pp = cp->lg_provider; + if (pp == NULL) + return (NULL); + LIST_FOREACH(conf, &cp->lg_config, lg_config) { + if (strcasecmp(conf->lg_name, "synchronized") == 0) + break; + } + if (conf == NULL) + snprintf(buf, sizeof(buf), "%s", pp->lg_name); + else { + snprintf(buf, sizeof(buf), "%s (%s)", pp->lg_name, + conf->lg_val); + } + return (buf); +} + +static void +status_one_geom(struct ggeom *gp, int script, int name_len, int status_len) +{ + struct gprovider *pp; + struct gconsumer *cp; + struct gconfig *conf; + const char *name, *status, *component; + int gotone; + + pp = LIST_FIRST(&gp->lg_provider); + if (pp != NULL) + name = pp->lg_name; + else + name = gp->lg_name; + LIST_FOREACH(conf, &gp->lg_config, lg_config) { + if (strcasecmp(conf->lg_name, "state") == 0) + break; + } + if (conf == NULL) + status = "N/A"; + else + status = conf->lg_val; + gotone = 0; + LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { + component = status_one_consumer(cp); + if (component == NULL) + continue; + gotone = 1; + printf("%*s %*s %s\n", name_len, name, status_len, status, + component); + if (!script) + name = status = ""; + } + if (!gotone) { + printf("%*s %*s %s\n", name_len, name, status_len, status, + "N/A"); + } +} + +static void +std_status(struct gctl_req *req, unsigned flags __unused) +{ + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; + int name_len, status_len; + int error, *nargs, *script; + + error = geom_gettree(&mesh); + if (error != 0) { + fprintf(stderr, "Cannot get GEOM tree: %s.\n", strerror(error)); + exit(EXIT_FAILURE); + } + classp = find_class(&mesh, gclass_name); + if (classp == NULL) { + fprintf(stderr, "Class %s not found.\n", gclass_name); + goto end; + } + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No '%s' argument.", "nargs"); + goto end; + } + script = gctl_get_paraml(req, "script", sizeof(*script)); + if (script == NULL) { + gctl_error(req, "No '%s' argument.", "script"); + goto end; + } + name_len = strlen("Name"); + status_len = strlen("Status"); + if (*nargs > 0) { + int i, n = 0; + + for (i = 0; i < *nargs; i++) { + const char *name; + char param[16]; + + snprintf(param, sizeof(param), "arg%d", i); + name = gctl_get_asciiparam(req, param); + assert(name != NULL); + gp = find_geom(classp, name); + if (gp == NULL) + fprintf(stderr, "No such geom: %s.\n", name); + else { + status_update_len(gp, &name_len, &status_len); + n++; + } + } + if (n == 0) + goto end; + } else { + int n = 0; + + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + if (LIST_EMPTY(&gp->lg_provider)) + continue; + status_update_len(gp, &name_len, &status_len); + n++; + } + if (n == 0) + goto end; + } + if (!*script) { + printf("%*s %*s %s\n", name_len, "Name", status_len, "Status", + "Components"); + } + if (*nargs > 0) { + int i; + + for (i = 0; i < *nargs; i++) { + const char *name; + char param[16]; + + snprintf(param, sizeof(param), "arg%d", i); + name = gctl_get_asciiparam(req, param); + assert(name != NULL); + gp = find_geom(classp, name); + if (gp != NULL) { + status_one_geom(gp, *script, name_len, + status_len); + } + } + } else { + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + if (LIST_EMPTY(&gp->lg_provider)) + continue; + status_one_geom(gp, *script, name_len, status_len); } } +end: geom_deletetree(&mesh); } @@ -822,6 +1020,8 @@ std_available(const char *name) return (1); else if (strcmp(name, "list") == 0) return (std_list_available()); + else if (strcmp(name, "status") == 0) + return (std_status_available()); else if (strcmp(name, "load") == 0) return (std_load_available()); else if (strcmp(name, "unload") == 0) Index: core/geom.h =================================================================== RCS file: /usr/repo/src/sbin/geom/core/geom.h,v retrieving revision 1.1 diff -u -p -r1.1 geom.h --- core/geom.h 20 May 2004 10:09:55 -0000 1.1 +++ core/geom.h 21 Mar 2005 16:16:07 -0000 @@ -28,7 +28,7 @@ #ifndef _GEOM_H_ #define _GEOM_H_ -#define G_LIB_VERSION 0 +#define G_LIB_VERSION 1 #define G_FLAG_NONE 0x0000 #define G_FLAG_VERBOSE 0x0001 @@ -44,7 +44,7 @@ #define G_OPT_SENTINEL { '\0', NULL, NULL, G_TYPE_NONE } #define G_NULL_OPTS { G_OPT_SENTINEL } -#define G_CMD_SENTINEL { NULL, 0, NULL, G_NULL_OPTS } +#define G_CMD_SENTINEL { NULL, 0, NULL, G_NULL_OPTS, NULL } struct g_option { char go_char; @@ -58,5 +58,6 @@ struct g_command { unsigned gc_flags; void (*gc_func)(struct gctl_req *, unsigned); struct g_option gc_options[G_OPT_MAX]; + const char *gc_usage; }; #endif /* !_GEOM_H_ */