This series of patches enhances the domain parser/formatter code to
support a sort of "intelligent hostdev", i.e. PCI passthrough where
device-type specific initialization is done prior to assigning the
device to the guest, in particular to allow setting the MAC address
and do 802.1QbX setup for network devices.
Rather than adding all of the device-type specific config to
<hostdev>, I accomplish this through adding a new type of <interface>
element, type='hostdev'. When an interface is type='hostdev' the
following is changed:
* in the toplevel device, the managed attribute can be specified
(with identical results as when it's specified in a <hostdev>
* The <source> element can specify a pci address or usb address,
just as can be done in <hostdev>. One notable difference is that
the type of the address is specified directly in the source
<address> element, rather than as an attribute of the toplevel
device (that's how it's done for <hostdev>, but for <interface>,
the toplevel element's type attribute is already used).
These patches include only the parser/formatter, test (for
domainschematest, and qemuxml2xmltest only), and doc changes; they
still need to be hooked into the domain's device lists (a type=hostdev
interface will reside in both the interface list (for configuration
and memory management) and hostdev list (for attach/detach, and
tracking of which devices are assigned)). I don't intend to push these
patches until that part is also done, but some other people are doing
work that depends on the changes to config format and data structures,
so I'm sending these patches now both to unblock them, as well as to
get feedback from everyone else on what needs to be changed.
The first 4 patches are just setup for the real new code - they
reorder and refactor existing code to allow greater re-use of existing
code and easier plugin of the new code. Patch 5/6 is just a couple of
lines, and patch 6/6 provides the new functionality.