Skip to content

Commit

Permalink
mogadm: show weight in "mogadm device list"
Browse files Browse the repository at this point in the history
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
Eric Wong authored and dormando committed Jan 10, 2013
1 parent ab1eb7d commit e5c1849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mogadm
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit e5c1849

Please sign in to comment.