From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-storage 1/1] api2: disks: add mounted boolean field
Date: Wed, 8 Jun 2022 07:09:59 +0000 [thread overview]
Message-ID: <20220608071000.3852-2-h.laimer@proxmox.com> (raw)
In-Reply-To: <20220608071000.3852-1-h.laimer@proxmox.com>
... and remove '(mounted)' from usage string
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
PVE/API2/Disks.pm | 1 +
PVE/Diskmanage.pm | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/PVE/API2/Disks.pm b/PVE/API2/Disks.pm
index b618057..bde6132 100644
--- a/PVE/API2/Disks.pm
+++ b/PVE/API2/Disks.pm
@@ -125,6 +125,7 @@ __PACKAGE__->register_method ({
},
used => { type => 'string', optional => 1 },
gpt => { type => 'boolean' },
+ mounted => { type => 'boolean' },
size => { type => 'integer'},
osdid => { type => 'integer'},
vendor => { type => 'string', optional => 1 },
diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index d67cc6b..253916b 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -605,6 +605,7 @@ sub get_disks {
size => $sysdata->{size},
serial => $data->{serial},
gpt => $data->{gpt},
+ mounted => exists $mounted->{$devpath},
rpm => $data->{rpm},
type => $type,
wwn => $data->{wwn},
@@ -650,10 +651,7 @@ sub get_disks {
}
my $fstype = $info->{fstype};
- if (defined($fstype)) {
- return "${fstype} (mounted)" if $mounted->{$devpath};
- return "${fstype}";
- }
+ return "${fstype}" if defined($fstype);
return 'mounted' if $mounted->{$devpath};
return if !$is_partition;
@@ -693,6 +691,7 @@ sub get_disks {
$partitions->{$part}->{devpath} = "$partpath/$part";
$partitions->{$part}->{parent} = "$devpath";
+ $partitions->{$part}->{mounted} = exists $mounted->{"$partpath/$part"};
$partitions->{$part}->{gpt} = $data->{gpt};
$partitions->{$part}->{type} = 'partition';
$partitions->{$part}->{size} =
--
2.30.2
next prev parent reply other threads:[~2022-06-08 7:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 7:09 [pve-devel] [PATCH proxmox-widget-toolkit/pve-storage] replace '(mounted)' string by " Hannes Laimer
2022-06-08 7:09 ` Hannes Laimer [this message]
2022-06-15 8:24 ` [pve-devel] applied: [PATCH pve-storage 1/1] api2: disks: add mounted " Wolfgang Bumiller
2022-06-08 7:10 ` [pve-devel] [PATCH proxmox-widget-toolkit 1/1] ui: disks: add 'mounted' column Hannes Laimer
2022-06-15 8:58 ` [pve-devel] applied: " Wolfgang Bumiller
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=20220608071000.3852-2-h.laimer@proxmox.com \
--to=h.laimer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.