On 04/26/2013 04:35 PM, Laine Stump wrote:
I remembered to document this bit, but somehow forgot to implement
it.
Worth including on 1.0.5, to avoid an incomplete feature introduction.
This adds <driver name='kvm|vfio'/> as a subelement to the <forward>
element of a network (this puts it parallel to the match between
mode='hostdev' attribute in a network and type='hostdev' in an
<interface>).
Since it's already documented, only the parser, formatter, backend
driver recognition (it just translates/moves the flag into the
<interface> at the appropriate time), and a test case were needed.
(I used a separate enum for the values both because the original is
defined in domain_conf.h, which is unavailable from network_conf.h,
and because in the future it's possible that we may want to support
other non-hostdev oriented driver names in the network parser; this
makes sure that one can be expanded without the other).
---
src/conf/network_conf.c | 39 +++++++++++++++++++++++++++++++++-
src/conf/network_conf.h | 17 ++++++++++++++-
src/network/bridge_driver.c | 23 ++++++++++++++++++++
tests/networkxml2xmlin/hostdev-pf.xml | 1 +
tests/networkxml2xmlout/hostdev-pf.xml | 1 +
5 files changed, 79 insertions(+), 2 deletions(-)
ACK.
+typedef enum {
+ VIR_NETWORK_FORWARD_DRIVER_NAME_DEFAULT, /* kvm now, could change */
+ VIR_NETWORK_FORWARD_DRIVER_NAME_KVM, /* force legacy kvm style */
+ VIR_NETWORK_FORWARD_DRIVER_NAME_VFIO, /* force vfio */
Were you trying to line up comments, or use one space after comma? It
ended up not being either.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org