[pve-devel] [PATCH v2 storage 2/3] add content type to pvesm list output
Tim Marx
t.marx at proxmox.com
Wed Nov 20 11:35:17 CET 2019
Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
PVE/CLI/pvesm.pm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm
index 01ddd23..63b212a 100755
--- a/PVE/CLI/pvesm.pm
+++ b/PVE/CLI/pvesm.pm
@@ -124,21 +124,23 @@ my $print_content = sub {
my $sidlen = length ($volid);
$maxlenname = $sidlen if $sidlen > $maxlenname;
}
+ printf "%-${maxlenname}s %-6s %-9s %-10s %s\n", "Volid",
+ "Format", "Type", "Size", "VMID";
foreach my $info (@$list) {
next if !$info->{vmid};
my $volid = $info->{volid};
- printf "%-${maxlenname}s %5s %10d %d\n", $volid,
- $info->{format}, $info->{size}, $info->{vmid};
+ printf "%-${maxlenname}s %-6s %-9s %-10d %d\n", $volid,
+ $info->{format}, $info->{content}, $info->{size}, $info->{vmid};
}
foreach my $info (sort { $a->{format} cmp $b->{format} } @$list) {
next if $info->{vmid};
my $volid = $info->{volid};
- printf "%-${maxlenname}s %5s %10d\n", $volid,
- $info->{format}, $info->{size};
+ printf "%-${maxlenname}s %-6s %-9s %-10d\n", $volid,
+ $info->{format}, $info->{content}, $info->{size};
}
};
@@ -506,7 +508,7 @@ __PACKAGE__->register_method ({
type => 'array',
items => {
type => "object",
- properties => {
+ properties => {
volname => {
description => "The volume name.",
type => 'string',
--
2.20.1
More information about the pve-devel
mailing list