From bcdb96a3e197ebe64048464c19f505637b8bb7ba Mon Sep 17 00:00:00 2001 From: N Clark Date: Mon, 3 Apr 2017 17:23:02 -0400 Subject: Additional Information for Zedlets * Add ZPOOL pool state to zfs_post_common to allow differentiation between export and destroy by zedlets. * Add pool name as standard export This ensures pool name is exported to zedlets. Reviewed-by: Tony Hutter Reviewed-by: Don Brady Reviewed-by: Brian Behlendorf Signed-off-by: Nathaniel Clark Closes #5942 --- cmd/zed/zed_event.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmd/zed/zed_event.c') diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c index b289ebf22..aecdb5146 100644 --- a/cmd/zed/zed_event.c +++ b/cmd/zed/zed_event.c @@ -653,6 +653,16 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp) (void) snprintf(alt, sizeof (alt), "%s_str", name); _zed_event_add_var(eid, zsp, prefix, alt, "%s", zpool_state_to_name(i64, VDEV_AUX_NONE)); + } else + /* + * shadow readable strings for pool state + */ + if (strcmp(name, FM_EREPORT_PAYLOAD_ZFS_POOL_STATE) == 0) { + char alt[32]; + + (void) snprintf(alt, sizeof (alt), "%s_str", name); + _zed_event_add_var(eid, zsp, prefix, alt, "%s", + zpool_pool_state_to_name(i32)); } break; case DATA_TYPE_DOUBLE: -- cgit v1.2.3