There are several libvirt functions, all with the
prefix virNodeDevice, which deal with management of
host devices that can be handed to guests via passthrough as
<hostdev> elements
in the domain XML.
These devices are represented as a hierarchy, where a device on
a bus has a parent of the bus controller device; the root of the
hierarchy is the node named "computer".
When represented in XML, a node device uses the
top-level device element, with the following
elements present according to the type of device:
nameparentcapabilitytype lists which category the device
belongs to, and controls which further subelements will be
present to describe the node:
systemproducthardwarevendor, version,
serial, and uuid.firmwarevendor, version,
and release_date.pcidomainbusslotfunctionproductid with the hexadecimal product
id, and an optional text description of that id.vendorid with the hexadecimal vendor
id, and an optional text name of that vendor.usb_devicebusdeviceproductid with the hexadecimal product
id, and an optional text description of that id.vendorid with the hexadecimal vendor
id, and an optional text name of that vendor.usbnumbernumbernumbernumberdescriptionnetinterfaceaddresscapabilitytype can be "80203" for IEEE
802.3, or "80211" for various flavors of IEEE 802.11.
scsi_hosthostcapabilitywwnn,
wwpn, fabric_wwn.
scsihostbustargetluntypestorageblockbusdrive_typemodelvendorserialsizecapabilitytype. Current capabilites
include "hotpluggable" and "removable", with the
latter implying the following
sub-elements: media_available (0 or
1), media_size,
and media_label.The following are some example node device XML outputs:
<device>
<name>computer</name>
<capability type='system'>
<product>2241B36</product>
<hardware>
<vendor>LENOVO</vendor>
<version>ThinkPad T500</version>
<serial>R89055N</serial>
<uuid>c9488981-5049-11cb-9c1c-993d0230b4cd</uuid>
</hardware>
<firmware>
<vendor>LENOVO</vendor>
<version>6FET82WW (3.12 )</version>
<release_date>11/26/2009</release_date>
</firmware>
</capability>
</device>
<device>
<name>net_eth1_00_27_13_6a_fe_00</name>
<parent>pci_0000_00_19_0</parent>
<capability type='net'>
<interface>eth1</interface>
<address>00:27:13:6a:fe:00</address>
<capability type='80203'/>
</capability>
</device>