From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 storage 1/1] fix #3610: properly build ZFS detail tree
Date: Fri, 10 Sep 2021 13:45:35 +0200 [thread overview]
Message-ID: <20210910114538.175196-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210910114538.175196-1-f.ebner@proxmox.com>
Previously, top-level vdevs like log or special were wrongly added as
children of the previous outer vdev instead of the root.
Fix it by also showing the vdev with the same name as the pool and
start counting from level 1 (the pool itself serves as the root and
should be the only one with level 0). This results in the same kind
of structure as in PBS and (except for the root) zpool status itself.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
No changes from v1.
PVE/API2/Disks/ZFS.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/Disks/ZFS.pm b/PVE/API2/Disks/ZFS.pm
index 0418794..60077c4 100644
--- a/PVE/API2/Disks/ZFS.pm
+++ b/PVE/API2/Disks/ZFS.pm
@@ -240,8 +240,8 @@ __PACKAGE__->register_method ({
$config = 1;
} elsif ($config && $line =~ m/^(\s+)(\S+)\s*(\S+)?(?:\s+(\S+)\s+(\S+)\s+(\S+))?\s*(.*)$/) {
my ($space, $name, $state, $read, $write, $cksum, $msg) = ($1, $2, $3, $4, $5, $6, $7);
- if ($name ne "NAME" and $name ne $param->{name}) {
- my $lvl= int(length($space)/2); # two spaces per level
+ if ($name ne "NAME") {
+ my $lvl = int(length($space) / 2) + 1; # two spaces per level
my $vdev = {
name => $name,
msg => $msg,
--
2.30.2
next prev parent reply other threads:[~2021-09-10 11:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 11:45 [pve-devel] [PATCH-SERIES v2 storage/widget-toolkit/manager] " Fabian Ebner
2021-09-10 11:45 ` Fabian Ebner [this message]
2021-09-10 12:19 ` [pve-devel] applied: [PATCH v2 storage 1/1] " Thomas Lamprecht
2021-09-10 11:45 ` [pve-devel] [PATCH v2 widget-toolkit 1/2] zfs detail: increase window height Fabian Ebner
2021-09-10 11:45 ` [pve-devel] [PATCH v2 widget-toolkit 2/2] zfs detail: hide the pool itself in tree view Fabian Ebner
2021-09-10 11:45 ` [pve-devel] [PATCH v2 manager 1/1] ui: node: zfs: use ZFSDetail window from widget-toolkit Fabian Ebner
2022-01-13 11:21 ` [pve-devel] [PATCH-SERIES v2 storage/widget-toolkit/manager] fix #3610: properly build ZFS detail tree Fabian Ebner
2022-01-13 11:58 ` [pve-devel] applied-series: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210910114538.175196-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox