]> granicus.if.org Git - zfs/commitdiff
Add missing DATA_TYPE_STRING_ARRAY output
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 24 Jan 2014 23:43:07 +0000 (15:43 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 2 Apr 2014 20:10:08 +0000 (13:10 -0700)
This functionality has always been missing.  But until now there
were no zevents which included an array of strings so it wasn't
missed.  However, that's now changed so to ensure this information
is output correctly by 'zpool events -v' the DATA_TYPE_STRING_ARRAY
has been implemented.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Issue #2

cmd/zpool/zpool_main.c

index cc13e37393944f30afe680578db8afa1d7d7dbae..e38213c8520e71d2b2d49a8e7b730e58009a0f32 100644 (file)
@@ -5439,7 +5439,18 @@ zpool_do_events_nvprint(nvlist_t *nvl, int depth)
                        break;
                        }
 
-               case DATA_TYPE_STRING_ARRAY:
+               case DATA_TYPE_STRING_ARRAY: {
+                       char **str;
+                       uint_t i, nelem;
+
+                       (void) nvpair_value_string_array(nvp, &str, &nelem);
+                       for (i = 0; i < nelem; i++)
+                               printf(gettext("\"%s\" "),
+                                   str[i] ? str[i] : "<NULL>");
+
+                       break;
+                       }
+
                case DATA_TYPE_BOOLEAN_ARRAY:
                case DATA_TYPE_BYTE_ARRAY:
                case DATA_TYPE_DOUBLE: