28c28
< __FBSDID("$FreeBSD: head/sbin/geom/class/eli/geom_eli.c 162347 2006-09-16 09:26:57Z pjd $");
---
> __FBSDID("$FreeBSD: head/sbin/geom/class/eli/geom_eli.c 162353 2006-09-16 10:43:17Z pjd $");
67a68
> static void eli_configure(struct gctl_req *req);
84a86
> * configure [-bB] prov ...
158a161,168
> { "configure", G_FLAG_VERBOSE, eli_main,
> {
> { 'b', "boot", NULL, G_TYPE_NONE },
> { 'B', "noboot", NULL, G_TYPE_NONE },
> G_OPT_SENTINEL
> },
> "[-bB] prov ..."
> },
244a255,256
> else if (strcmp(name, "configure") == 0)
> eli_configure(req);
668a681,738
> eli_configure_detached(struct gctl_req *req, const char *prov, int boot)
> {
> struct g_eli_metadata md;
>
> if (eli_metadata_read(req, prov, &md) == -1)
> return;
>
> if (boot && (md.md_flags & G_ELI_FLAG_BOOT)) {
> if (verbose)
> printf("BOOT flag already configured for %s.\n", prov);
> } else if (!boot && !(md.md_flags & G_ELI_FLAG_BOOT)) {
> if (verbose)
> printf("BOOT flag not configured for %s.\n", prov);
> } else {
> if (boot)
> md.md_flags |= G_ELI_FLAG_BOOT;
> else
> md.md_flags &= ~G_ELI_FLAG_BOOT;
> eli_metadata_store(req, prov, &md);
> }
> bzero(&md, sizeof(md));
> }
>
> static void
> eli_configure(struct gctl_req *req)
> {
> const char *prov;
> int i, nargs, boot, noboot;
>
> nargs = gctl_get_int(req, "nargs");
> if (nargs == 0) {
> gctl_error(req, "Too few arguments.");
> return;
> }
>
> boot = gctl_get_int(req, "boot");
> noboot = gctl_get_int(req, "noboot");
>
> if (boot && noboot) {
> gctl_error(req, "Options -b and -B are mutually exclusive.");
> return;
> }
> if (!boot && !noboot) {
> gctl_error(req, "No option given.");
> return;
> }
>
> /* First attached providers. */
> gctl_issue(req);
> /* Now the rest. */
> for (i = 0; i < nargs; i++) {
> prov = gctl_get_ascii(req, "arg%d", i);
> if (!eli_is_attached(prov))
> eli_configure_detached(req, prov, boot);
> }
> }
>
> static void
< __FBSDID("$FreeBSD: head/sbin/geom/class/eli/geom_eli.c 162347 2006-09-16 09:26:57Z pjd $");
---
> __FBSDID("$FreeBSD: head/sbin/geom/class/eli/geom_eli.c 162353 2006-09-16 10:43:17Z pjd $");
67a68
> static void eli_configure(struct gctl_req *req);
84a86
> * configure [-bB] prov ...
158a161,168
> { "configure", G_FLAG_VERBOSE, eli_main,
> {
> { 'b', "boot", NULL, G_TYPE_NONE },
> { 'B', "noboot", NULL, G_TYPE_NONE },
> G_OPT_SENTINEL
> },
> "[-bB] prov ..."
> },
244a255,256
> else if (strcmp(name, "configure") == 0)
> eli_configure(req);
668a681,738
> eli_configure_detached(struct gctl_req *req, const char *prov, int boot)
> {
> struct g_eli_metadata md;
>
> if (eli_metadata_read(req, prov, &md) == -1)
> return;
>
> if (boot && (md.md_flags & G_ELI_FLAG_BOOT)) {
> if (verbose)
> printf("BOOT flag already configured for %s.\n", prov);
> } else if (!boot && !(md.md_flags & G_ELI_FLAG_BOOT)) {
> if (verbose)
> printf("BOOT flag not configured for %s.\n", prov);
> } else {
> if (boot)
> md.md_flags |= G_ELI_FLAG_BOOT;
> else
> md.md_flags &= ~G_ELI_FLAG_BOOT;
> eli_metadata_store(req, prov, &md);
> }
> bzero(&md, sizeof(md));
> }
>
> static void
> eli_configure(struct gctl_req *req)
> {
> const char *prov;
> int i, nargs, boot, noboot;
>
> nargs = gctl_get_int(req, "nargs");
> if (nargs == 0) {
> gctl_error(req, "Too few arguments.");
> return;
> }
>
> boot = gctl_get_int(req, "boot");
> noboot = gctl_get_int(req, "noboot");
>
> if (boot && noboot) {
> gctl_error(req, "Options -b and -B are mutually exclusive.");
> return;
> }
> if (!boot && !noboot) {
> gctl_error(req, "No option given.");
> return;
> }
>
> /* First attached providers. */
> gctl_issue(req);
> /* Now the rest. */
> for (i = 0; i < nargs; i++) {
> prov = gctl_get_ascii(req, "arg%d", i);
> if (!eli_is_attached(prov))
> eli_configure_detached(req, prov, boot);
> }
> }
>
> static void