mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Expose virConnectGetStoragePoolCapabilities
https://bugzilla.redhat.com/show_bug.cgi?id=1581670 Add a new storage pool command "pool-capabilities" to output the storage pool capabilities. Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
d9bf6cef32
commit
d9a4115892
@ -2105,6 +2105,42 @@ cmdPoolEvent(vshControl *ctl, const vshCmd *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "pool-capabilities" command
|
||||||
|
*/
|
||||||
|
static const vshCmdInfo info_pool_capabilities[] = {
|
||||||
|
{.name = "help",
|
||||||
|
.data = N_("storage pool capabilities")
|
||||||
|
},
|
||||||
|
{.name = "desc",
|
||||||
|
.data = N_("Returns capabilities of storage pool support.")
|
||||||
|
},
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const vshCmdOptDef opts_pool_capabilities[] = {
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool
|
||||||
|
cmdPoolCapabilities(vshControl *ctl,
|
||||||
|
const vshCmd *cmd ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
const unsigned int flags = 0; /* No flags so far */
|
||||||
|
virshControlPtr priv = ctl->privData;
|
||||||
|
VIR_AUTOFREE(char *) caps = NULL;
|
||||||
|
|
||||||
|
caps = virConnectGetStoragePoolCapabilities(priv->conn, flags);
|
||||||
|
if (!caps) {
|
||||||
|
vshError(ctl, "%s", _("failed to get storage pool capabilities"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
vshPrint(ctl, "%s\n", caps);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const vshCmdDef storagePoolCmds[] = {
|
const vshCmdDef storagePoolCmds[] = {
|
||||||
{.name = "find-storage-pool-sources-as",
|
{.name = "find-storage-pool-sources-as",
|
||||||
.handler = cmdPoolDiscoverSourcesAs,
|
.handler = cmdPoolDiscoverSourcesAs,
|
||||||
@ -2226,5 +2262,11 @@ const vshCmdDef storagePoolCmds[] = {
|
|||||||
.info = info_pool_event,
|
.info = info_pool_event,
|
||||||
.flags = 0
|
.flags = 0
|
||||||
},
|
},
|
||||||
|
{.name = "pool-capabilities",
|
||||||
|
.handler = cmdPoolCapabilities,
|
||||||
|
.opts = opts_pool_capabilities,
|
||||||
|
.info = info_pool_capabilities,
|
||||||
|
.flags = 0
|
||||||
|
},
|
||||||
{.name = NULL}
|
{.name = NULL}
|
||||||
};
|
};
|
||||||
|
@ -389,6 +389,13 @@ supplied along with either the I<emulatorbin> or I<arch> in order to
|
|||||||
generate output for the default I<machine>. Supplying a I<machine>
|
generate output for the default I<machine>. Supplying a I<machine>
|
||||||
value will generate output for the specific machine.
|
value will generate output for the specific machine.
|
||||||
|
|
||||||
|
=item B<pool-capabilities>
|
||||||
|
Print an XML document describing the storage pool capabilities for the
|
||||||
|
connected storage driver. This may be useful if you intend to create a
|
||||||
|
new storage pool and need to know the available pool types and supported
|
||||||
|
storage pool source and target volume formats as well as the required
|
||||||
|
source elements to create the pool.
|
||||||
|
|
||||||
=item B<inject-nmi> I<domain>
|
=item B<inject-nmi> I<domain>
|
||||||
|
|
||||||
Inject NMI to the guest.
|
Inject NMI to the guest.
|
||||||
|
Loading…
Reference in New Issue
Block a user