optional => 1,
completion => \&PVE::Cluster::get_nodelist,
}),
+ format => {
+ description => "Include information about formats",
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
},
},
returns => {
my $cfg = PVE::Storage::config();
- my $info = PVE::Storage::storage_info($cfg, $param->{content});
+ my $info = PVE::Storage::storage_info($cfg, $param->{content}, $param->{format});
raise_param_exc({ storage => "No such storage." })
if $param->{storage} && !defined($info->{$param->{storage}});
}
sub storage_info {
- my ($cfg, $content) = @_;
+ my ($cfg, $content, $includeformat) = @_;
my $ids = $cfg->{ids};
next if !$info->{$storeid};
next if !$info->{$storeid}->{enabled};
+ my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+ if ($includeformat) {
+ my $pd = $plugin->plugindata();
+ $info->{$storeid}->{format} = $pd->{format}
+ if $pd->{format};
+ $info->{$storeid}->{select_existing} = $pd->{select_existing}
+ if $pd->{select_existing};
+ }
+
eval { activate_storage($cfg, $storeid, $cache); };
if (my $err = $@) {
warn $err;
next;
}
- my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
my ($total, $avail, $used, $active);
eval { ($total, $avail, $used, $active) = $plugin->status($storeid, $scfg, $cache); };
warn $@ if $@;