From f675c5e97853d605e3216ccf91ba9d2b7674844c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 19 Jun 2020 16:55:28 +0200 Subject: [PATCH] src/tools/disks/zpool_status.rs - add all attributes to the tree --- src/tools/disks/zpool_status.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tools/disks/zpool_status.rs b/src/tools/disks/zpool_status.rs index 08422345..54d67eeb 100644 --- a/src/tools/disks/zpool_status.rs +++ b/src/tools/disks/zpool_status.rs @@ -182,6 +182,21 @@ pub fn vdev_list_to_tree(vdev_list: &[ZFSPoolVDevState]) -> Result indented_list_to_tree(vdev_list, |vdev, node| { node.insert("name".to_string(), Value::String(vdev.name.clone())); node.insert("lvl".to_string(), Value::Number(vdev.lvl.into())); + if let Some(ref state) = vdev.state { + node.insert("state".to_string(), Value::String(state.clone())); + } + if let Some(ref msg) = vdev.msg { + node.insert("msg".to_string(), Value::String(msg.clone())); + } + if let Some(read) = vdev.read { + node.insert("read".to_string(), Value::Number(read.into())); + } + if let Some(write) = vdev.write { + node.insert("write".to_string(), Value::Number(write.into())); + } + if let Some(cksum) = vdev.cksum { + node.insert("cksum".to_string(), Value::Number(cksum.into())); + } vdev.lvl }) }