Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/raidctl convert "component*" into "absent" for "START d...



details:   https://anonhg.NetBSD.org/src/rev/f236256c163f
branches:  trunk
changeset: 809560:f236256c163f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Jul 21 05:54:44 2015 +0000

description:
convert "component*" into "absent" for "START disks" part of the
output from "raidctl -G".  now this actually works when fed back
into raidctl -[cC].

diffstat:

 sbin/raidctl/raidctl.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 66b088a74a15 -r f236256c163f sbin/raidctl/raidctl.c
--- a/sbin/raidctl/raidctl.c    Tue Jul 21 03:15:50 2015 +0000
+++ b/sbin/raidctl/raidctl.c    Tue Jul 21 05:54:44 2015 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: raidctl.c,v 1.61 2015/06/30 17:02:14 sborrill Exp $   */
+/*      $NetBSD: raidctl.c,v 1.62 2015/07/21 05:54:44 mrg Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.61 2015/06/30 17:02:14 sborrill Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.62 2015/07/21 05:54:44 mrg Exp $");
 #endif
 
 
@@ -576,6 +576,14 @@
            raidID, dis ? "dis" : "en");
 }
 
+/* convert "component0" into "absent" */
+static const char *rf_output_devname(const char *devname)
+{
+
+       if (strncmp(devname, "component", 9) == 0)
+               return "absent";
+       return devname;
+}
 
 static void
 rf_output_configuration(int fd, const char *name)
@@ -602,7 +610,8 @@
 
        printf("START disks\n");
        for(i=0; i < device_config.ndevs; i++)
-               printf("%s\n", device_config.devs[i].devname);
+               printf("%s\n",
+                   rf_output_devname(device_config.devs[i].devname));
        printf("\n");
 
        if (device_config.nspares > 0) {



Home | Main Index | Thread Index | Old Index