summaryrefslogtreecommitdiff
path: root/sbin/bioctl/bioctl.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-01-07 12:16:47 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-01-07 12:16:47 +0000
commita7dc22cd7fbce1108032eb0d3d6dcf8023317fe9 (patch)
tree2b7569d8e7fc011d23464e515c492485dfe6de25 /sbin/bioctl/bioctl.c
parent0d05123a5edf37e129408cf04a6d71dbd6cbe9f2 (diff)
Provide a bioctl(8) option that changes the state of a chunk to offline.
man page part with todd@
Diffstat (limited to 'sbin/bioctl/bioctl.c')
-rw-r--r--sbin/bioctl/bioctl.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c
index 69fbc4c43c5..fa3d2b4788c 100644
--- a/sbin/bioctl/bioctl.c
+++ b/sbin/bioctl/bioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioctl.c,v 1.104 2011/12/31 17:06:09 jsing Exp $ */
+/* $OpenBSD: bioctl.c,v 1.105 2012/01/07 12:16:46 jsing Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
if (argc < 2)
usage();
- while ((ch = getopt(argc, argv, "a:b:C:c:dH:hik:l:Pp:qr:R:svu:")) !=
+ while ((ch = getopt(argc, argv, "a:b:C:c:dH:hik:l:O:Pp:qr:R:svu:")) !=
-1) {
switch (ch) {
case 'a': /* alarm */
@@ -172,6 +172,12 @@ main(int argc, char *argv[])
errx(1, "Number of rounds is %s: %s",
errstr, optarg);
break;
+ case 'O':
+ /* set a chunk to offline */
+ func |= BIOC_SETSTATE;
+ ss_func = BIOC_SSOFFLINE;
+ al_arg = optarg;
+ break;
case 'R':
/* rebuild to provided chunk/CTL */
func |= BIOC_SETSTATE;
@@ -261,8 +267,10 @@ usage(void)
"device\n"
" %s [-dhiPqsv] "
"[-C flag[,flag,...]] [-c raidlevel] [-k keydisk]\n"
- "\t[-l special[,special,...]] [-p passfile]\n"
- "\t[-R device | channel:target[.lun]] [-r rounds] "
+ "\t[-l special[,special,...]] "
+ "[-O device | channel:target[.lun]]\n"
+ "\t[-p passfile] [-R device | channel:target[.lun]]\n"
+ "\t[-r rounds] "
"device\n", __progname, __progname);
exit(1);