On 28.02.2012 21:14, Laine Stump wrote:
This patch makes sure that each network device
("interface") of
type='hostdev' appears on both the hostdevs list and the nets list of
the virDomainDef, and it modifies the qemu driver startup code so that
these devices will be presented to qemu on the commandline as hostdevs
rather than as network devices.
It does not add support for hotplug of these type of devices, or code
to honor the <mac address> or <virtualport> given in the config (both
of those will be done in separate patches).
Once each device is placed on both lists, much of what this patch does
is modify places in the code that traverse all the device lists so
that these hybrid devices are only acted on once - either along with
the other hostdevs, or along with the other interfaces. (In many
cases, only one of the lists is traversed / a specific operation is
performed on only one type of device. In those instances, the code can
remain unchanged.)
There is one special case - when building the commandline, interfaces
are allowed to proceed all the way through
networkAllocateActualDevice() before deciding to skip - this is so
that (once we have support for networks with pools of hostdev devices)
we can get the actual device allocated, then rely on the loop
processing all hostdevs to generate the correct commandline.
---
New patch in V2.
src/conf/domain_conf.c | 54 +++++++++++++++++---
src/qemu/qemu_command.c | 36 ++++++++++++--
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.args | 7 +++
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.xml | 7 ---
tests/qemuxml2argvtest.c | 2 +
5 files changed, 88 insertions(+), 18 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.args
ACK
Michal