.type = VSH_OT_BOOL,
.help = N_("list UUID of active pools only")
},
+ {.name = "name",
+ .type = VSH_OT_BOOL,
+ .help = N_("list name of active pools only")
+ },
{.name = NULL}
};
bool details = vshCommandOptBool(cmd, "details");
bool inactive, all;
bool uuid = false;
+ bool name = false;
char *outputStr = NULL;
inactive = vshCommandOptBool(cmd, "inactive");
if (vshCommandOptBool(cmd, "uuid"))
uuid = true;
+ if (vshCommandOptBool(cmd, "name"))
+ name = true;
+
if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
return false;
VSH_EXCLUSIVE_OPTIONS("details", "uuid");
+ VSH_EXCLUSIVE_OPTIONS("details", "name");
if (type) {
int poolType = -1;
goto cleanup;
}
+ if (name) {
+ for (i = 0; i < list->npools; i++) {
+ const char *name_str = virStoragePoolGetName(list->pools[i]);
+ vshPrint(ctl, "%-20s\n", name_str);
+ }
+ ret = true;
+ goto cleanup;
+ }
+
/* Output old style header */
vshPrintExtra(ctl, " %-20s %-10s %-10s\n", _("Name"), _("State"),
_("Autostart"));
/* Output old style pool info */
for (i = 0; i < list->npools; i++) {
- const char *name = virStoragePoolGetName(list->pools[i]);
+ const char *name_str = virStoragePoolGetName(list->pools[i]);
vshPrint(ctl, " %-20s %-10s %-10s\n",
- name,
+ name_str,
poolInfoTexts[i].state,
poolInfoTexts[i].autostart);
}
=item B<pool-list> [I<--inactive>] [I<--all>]
[I<--persistent>] [I<--transient>]
[I<--autostart>] [I<--no-autostart>]
- [[I<--details>] [I<--uuid>] [<type>]
+ [[I<--details>] [I<--uuid>]
+ [I<--name>] [<type>]
List pool objects known to libvirt. By default, only active pools
are listed; I<--inactive> lists just the inactive pools, and I<--all>
list the persistent pools, I<--transient> is to list the transient pools.
I<--autostart> lists the autostarting pools, I<--no-autostart> lists the pools
with autostarting disabled. If I<--uuid> is specified only pool's UUIDs are printed.
+If I<--name> is specified only pool's names are printed.
You may also want to list pools with specified types using I<type>, the
pool types must be separated by comma, e.g. --type dir,disk. The valid pool