mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
tools: add option inactive to nodedev-dumpxml
Allow to dump the XML of the persistent mdev when the mdev has been started instead of the current state only. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e67bca23e4
commit
6fcf613c6f
@ -5422,14 +5422,17 @@ nodedev-dumpxml
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
nodedev-dumpxml [--xpath EXPRESSION] [--wrap] device
|
nodedev-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] device
|
||||||
|
|
||||||
Dump a <device> XML representation for the given node device, including
|
Dump a <device> XML representation for the given node device, including
|
||||||
such information as the device name, which bus owns the device, the
|
such information as the device name, which bus owns the device, the
|
||||||
vendor and product id, and any capabilities of the device usable by
|
vendor and product id, and any capabilities of the device usable by
|
||||||
libvirt (such as whether device reset is supported). *device* can
|
libvirt (such as whether device reset is supported). *device* can
|
||||||
be either device name or wwn pair in "wwnn,wwpn" format (only works
|
be either device name or wwn pair in "wwnn,wwpn" format (only works
|
||||||
for HBA).
|
for HBA). An additional option affecting the XML dump may be
|
||||||
|
used. *--inactive* tells virsh to dump the node device configuration
|
||||||
|
that will be used on next start of the node device as opposed to the
|
||||||
|
current node device configuration.
|
||||||
|
|
||||||
If the **--xpath** argument provides an XPath expression, it will be
|
If the **--xpath** argument provides an XPath expression, it will be
|
||||||
evaluated against the output XML and only those matching nodes will
|
evaluated against the output XML and only those matching nodes will
|
||||||
|
@ -575,6 +575,10 @@ static const vshCmdOptDef opts_node_device_dumpxml[] = {
|
|||||||
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
|
.help = N_("device name or wwn pair in 'wwnn,wwpn' format"),
|
||||||
.completer = virshNodeDeviceNameCompleter,
|
.completer = virshNodeDeviceNameCompleter,
|
||||||
},
|
},
|
||||||
|
{.name = "inactive",
|
||||||
|
.type = VSH_OT_BOOL,
|
||||||
|
.help = N_("show inactive defined XML"),
|
||||||
|
},
|
||||||
{.name = "xpath",
|
{.name = "xpath",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
.flags = VSH_OFLAG_REQ_OPT,
|
.flags = VSH_OFLAG_REQ_OPT,
|
||||||
@ -594,6 +598,7 @@ cmdNodeDeviceDumpXML(vshControl *ctl, const vshCmd *cmd)
|
|||||||
g_autoptr(virshNodeDevice) device = NULL;
|
g_autoptr(virshNodeDevice) device = NULL;
|
||||||
g_autofree char *xml = NULL;
|
g_autofree char *xml = NULL;
|
||||||
const char *device_value = NULL;
|
const char *device_value = NULL;
|
||||||
|
unsigned int flags = 0;
|
||||||
bool wrap = vshCommandOptBool(cmd, "wrap");
|
bool wrap = vshCommandOptBool(cmd, "wrap");
|
||||||
const char *xpath = NULL;
|
const char *xpath = NULL;
|
||||||
|
|
||||||
@ -608,7 +613,10 @@ cmdNodeDeviceDumpXML(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (!device)
|
if (!device)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!(xml = virNodeDeviceGetXMLDesc(device, 0)))
|
if (vshCommandOptBool(cmd, "inactive"))
|
||||||
|
flags |= VIR_NODE_DEVICE_XML_INACTIVE;
|
||||||
|
|
||||||
|
if (!(xml = virNodeDeviceGetXMLDesc(device, flags)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return virshDumpXML(ctl, xml, "node-device", xpath, wrap);
|
return virshDumpXML(ctl, xml, "node-device", xpath, wrap);
|
||||||
|
Loading…
Reference in New Issue
Block a user