static const vshCmdOptDef opts_pool_info[] = {
VIRSH_COMMON_OPT_POOL_FULL,
+ {.name = "bytes",
+ .type = VSH_OT_BOOL,
+ .help = N_("Reture pool info in bytes"),
+ },
{.name = NULL}
};
int autostart = 0;
int persistent = 0;
bool ret = true;
+ bool bytes = false;
char uuid[VIR_UUID_STRING_BUFLEN];
if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
return false;
+ bytes = vshCommandOptBool(cmd, "bytes");
+
vshPrint(ctl, "%-15s %s\n", _("Name:"), virStoragePoolGetName(pool));
if (virStoragePoolGetUUIDString(pool, &uuid[0]) == 0)
if (info.state == VIR_STORAGE_POOL_RUNNING ||
info.state == VIR_STORAGE_POOL_DEGRADED) {
- val = vshPrettyCapacity(info.capacity, &unit);
- vshPrint(ctl, "%-15s %2.2lf %s\n", _("Capacity:"), val, unit);
+ if (bytes) {
+ vshPrint(ctl, "%-15s %llu\n", _("Capacity:"), info.capacity);
+ vshPrint(ctl, "%-15s %llu\n", _("Allocation:"), info.allocation);
+ vshPrint(ctl, "%-15s %llu\n", _("Available:"), info.available);
+ } else {
+ val = vshPrettyCapacity(info.capacity, &unit);
+ vshPrint(ctl, "%-15s %2.2lf %s\n", _("Capacity:"), val, unit);
- val = vshPrettyCapacity(info.allocation, &unit);
- vshPrint(ctl, "%-15s %2.2lf %s\n", _("Allocation:"), val, unit);
+ val = vshPrettyCapacity(info.allocation, &unit);
+ vshPrint(ctl, "%-15s %2.2lf %s\n", _("Allocation:"), val, unit);
- val = vshPrettyCapacity(info.available, &unit);
- vshPrint(ctl, "%-15s %2.2lf %s\n", _("Available:"), val, unit);
+ val = vshPrettyCapacity(info.available, &unit);
+ vshPrint(ctl, "%-15s %2.2lf %s\n", _("Available:"), val, unit);
+ }
}
} else {
ret = false;
The editor used can be supplied by the C<$VISUAL> or C<$EDITOR> environment
variables, and defaults to C<vi>.
-=item B<pool-info> I<pool-or-uuid>
+=item B<pool-info> [I<--bytes>] I<pool-or-uuid>
-Returns basic information about the I<pool> object.
+Returns basic information about the I<pool> object. If I<--bytes> is specified the sizes
+of basic info are not converted to human friendly units.
=item B<pool-list> [I<--inactive>] [I<--all>]
[I<--persistent>] [I<--transient>]