mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
virInterface: Expose link state & speed
Currently it is not possible to determine the speed of an interface
and whether a link is actually detected from the API. Orchestrating
platforms want to be able to determine when the link has failed and
where multiple speeds may be available which one the interface is
actually connected at. This commit introduces an extension to our
interface XML (without implementation to interface driver backends):
<interface type='ethernet' name='eth0'>
<start mode='none'/>
<mac address='aa:bb:cc:dd:ee:ff'/>
<link speed='1000' state='up'/>
<mtu size='1492'/>
...
</interface>
Where @speed is negotiated link speed in Mbits per second, and state
is the current NIC state (can be one of the following: "unknown",
"notpresent", "down", "lowerlayerdown","testing", "dormant", "up").
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
10c10f4380
commit
3db89662c2
10 files changed
+133
-2
No files matched your search
@@ -397,4 +397,29 @@
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name="link-speed-state">
|
||||
<optional>
|
||||
<element name="link">
|
||||
<optional>
|
||||
<attribute name="speed">
|
||||
<ref name="unsignedInt"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="state">
|
||||
<choice>
|
||||
<value>unknown</value>
|
||||
<value>notpresent</value>
|
||||
<value>down</value>
|
||||
<value>lowerlayerdown</value>
|
||||
<value>testing</value>
|
||||
<value>dormant</value>
|
||||
<value>up</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
</grammar>
|
||||
@@ -41,6 +41,7 @@
|
||||
<attribute name="address"><ref name="macAddr"/></attribute>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name="link-speed-state"/>
|
||||
<!-- FIXME: Allow (some) ethtool options -->
|
||||
</define>
|
||||
|
||||
|
||||
Reference in new issue
Block a user