mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
node_device: Expose link state & speed
While exposing the info under <interface/> in previous patch works, it
may work only in cases where interface is configured on the host.
However, orchestrating application may want to know the link state and
speed even in that case. That's why we ought to expose this in nodedev
XML too:
virsh # nodedev-dumpxml net_eth0_f0_de_f1_2b_1b_f3
<device>
<name>net_eth0_f0_de_f1_2b_1b_f3</name>
<path>/sys/devices/pci0000:00/0000:00:19.0/net/eth0</path>
<parent>pci_0000_00_19_0</parent>
<capability type='net'>
<interface>eth0</interface>
<address>f0🇩🇪f1:2b:1b:f3</address>
<link speed='1000' state='up'/>
<capability type='80203'/>
</capability>
</device>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@@ -161,6 +161,13 @@
|
||||
<dd>The interface name tied to this device.</dd>
|
||||
<dt><code>address</code></dt>
|
||||
<dd>If present, the MAC address of the device.</dd>
|
||||
<dt><code>link</code></dt>
|
||||
<dd>Optional to reflect the status of the link. It has
|
||||
two optional attributes: <code>speed</code> in Mbits per
|
||||
second and <code>state</code> to tell the state of the
|
||||
link. So far, the whole element is just for output,
|
||||
not setting.
|
||||
</dd>
|
||||
<dt><code>capability</code></dt>
|
||||
<dd>A network protocol exposed by the device, where the
|
||||
attribute <code>type</code> can be "80203" for IEEE
|
||||
|
||||
@@ -243,6 +243,7 @@
|
||||
<ref name='mac'/>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name="link-speed-state"/>
|
||||
|
||||
<zeroOrMore>
|
||||
<ref name='subcapnet'/>
|
||||
|
||||
Reference in New Issue
Block a user