]> git.proxmox.com Git - pve-storage.git/commitdiff
add content type to pvesm list output
authorTim Marx <t.marx@proxmox.com>
Wed, 20 Nov 2019 10:35:17 +0000 (11:35 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Nov 2019 08:01:43 +0000 (09:01 +0100)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
PVE/CLI/pvesm.pm

index 01ddd23c026787a4ca9f7a6e9d42232c50c73f3b..63b212ae43081b8c3a8772b08a705cfde5b526d2 100755 (executable)
@@ -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',