Permalink
Browse files

mogadm: show weight in "mogadm device list"

mogadm provides a way to set the device weight, so there should
be a way to view it from the same tool.

Conflicts:
	mogadm
  • Loading branch information...
1 parent ab1eb7d commit e5c1849cb901a73e1cb597acdf2cb90b6ca7150c Eric Wong committed with dormando Oct 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 mogadm
View
4 mogadm
@@ -817,15 +817,15 @@ sub cmd_device_list {
}
print "$host->{hostname} [$hostid]: $host->{status}\n";
- printf "%6s %-10s %7s %7s %7s\n", '', '', 'used(G)', 'free(G)', 'total(G)';
+ printf "%6s %-10s %7s %7s %7s %7s\n", '', '', 'used(G)', 'free(G)', 'total(G)', 'weight(%)';
foreach my $devid (sort keys %{$devs->{$hostid} || {}}) {
my $dev = $devs->{$hostid}->{$devid};
next if $dev->{status} eq "dead" && ! $args->{all};
my $total = $dev->{mb_total} / 1024;
my $used = $dev->{mb_used} / 1024;
my $free = $total - $used;
- printf "%6s: %-10s %-7.3f %-7.3f %-7.3f\n", "dev$devid", $dev->{status}, $used, $free, $total;
+ printf "%6s: %-10s %-7.3f %-7.3f %-7.3f % 3u\n", "dev$devid", $dev->{status}, $used, $free, $total, $dev->{weight};
}
print "\n";

0 comments on commit e5c1849

Please sign in to comment.