Add vdev_state to common post info
This was done because there are now lots of resource.fs.zfs.statechange events being posted but they do not include the state. For the moment the state must always be healthy but there's no harm in making this explicit.
This commit is contained in:
parent
f275e82de9
commit
1a493a9555
|
@ -67,6 +67,7 @@ extern "C" {
|
|||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_PATH "vdev_path"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_DEVID "vdev_devid"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_FRU "vdev_fru"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE "vdev_state"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_GUID "parent_guid"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_TYPE "parent_type"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_PATH "parent_path"
|
||||
|
|
|
@ -820,9 +820,12 @@ zfs_post_common(spa_t *spa, vdev_t *vd, const char *name)
|
|||
VERIFY(nvlist_add_string(resource, FM_CLASS, class) == 0);
|
||||
VERIFY(nvlist_add_uint64(resource,
|
||||
FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, spa_guid(spa)) == 0);
|
||||
if (vd)
|
||||
if (vd) {
|
||||
VERIFY(nvlist_add_uint64(resource,
|
||||
FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, vd->vdev_guid) == 0);
|
||||
VERIFY(nvlist_add_uint64(resource,
|
||||
FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE, vd->vdev_state) == 0);
|
||||
}
|
||||
|
||||
fm_zevent_post(resource, NULL, zfs_zevent_post_cb);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue