[libvirt] [PATCH 0/2] Xen: Add support for interface model='netfront'

Jiri Denemark jdenemar at redhat.com
Fri Nov 27 18:00:47 UTC 2009


Xen HVM guests with PV drivers end up with two network interfaces for
each configured interface. One of them being emulated by qemu and the
other one paravirtual. As this might not be desirable, the attached
patch provides a way for users to specify that only paravirtual network
interface should be presented to the guest.

The configuration was inspired by qemu/kvm driver, for which users can
specify model='virtio' to use paravirtual network interface.

The patch adds support for model='netfront' which results in
type=netfront instead of type=ioemu (or nothing for newer xen versions)
in guests native configuration. Xen's qemu ignores interfaces with
type != ioemu and only paravirtual network device will be seen in the
guest.

Four possible configuration scenarios follow:

- no model specified in domain's XML
    - libvirt will behave like before this change; it will set
      type=ioemu for HVM guests on xen host which is not newer than
      XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
    - covered by existing tests

- PV guest, any model
    - no functional change, model is passed as is (and ignored by the
      hypervisor)
    - covered by existing tests (e.g., *-net-e1000.*)

- HVM guest, model=netfront
    - type is set to "netfront", model is not specified
    - covered by new *-net-netfront.* tests

- HVM guest, model != netfront
    - type is set to "ioemu", model is passed as is
    - covered by new *-net-ioemu.* tests

The fourth scenario feels like a regression for xen newer than
XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU as users who had a model specified
in their guest's configuration won't see a paravirtual interface in
their guests any more. On the other hand, the reason for specifying a
model is most likely the fact that they want to use such model which
implies emulated interface. Users of older xen won't be affected at all
as their xen provides paravirtual interface regardless of the type used.

In previous version of this patch, I used "xenpv" instead of "netfront"
as it looked more like kvm/qemu's virtio. However, you can find several
tips how to force PV network interface for HVM guest by using
type="netfront" so I changed it to conform with those tips. It also
matches guest's driver name used for that device.

Jiri Denemark (2):
  Support for interface model='netfront'
  Tests for interface type/model configuration

 src/xen/xend_internal.c                            |   32 +++++++++++----
 src/xen/xm_internal.c                              |   38 +++++++++++++++--
 tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.sexpr   |    1 +
 tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml     |   42 +++++++++++++++++++
 .../sexpr2xmldata/sexpr2xml-fv-net-netfront.sexpr  |    1 +
 tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml  |   42 +++++++++++++++++++
 tests/sexpr2xmltest.c                              |    3 +
 tests/xmconfigdata/test-fullvirt-net-ioemu.cfg     |   25 +++++++++++
 tests/xmconfigdata/test-fullvirt-net-ioemu.xml     |   43 ++++++++++++++++++++
 tests/xmconfigdata/test-fullvirt-net-netfront.cfg  |   25 +++++++++++
 tests/xmconfigdata/test-fullvirt-net-netfront.xml  |   43 ++++++++++++++++++++
 tests/xmconfigtest.c                               |    3 +
 tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr   |    1 +
 tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.xml     |   31 ++++++++++++++
 .../xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr  |    1 +
 tests/xml2sexprdata/xml2sexpr-fv-net-netfront.xml  |   31 ++++++++++++++
 tests/xml2sexprtest.c                              |    3 +
 17 files changed, 352 insertions(+), 13 deletions(-)
 create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.sexpr
 create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml
 create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.sexpr
 create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml
 create mode 100644 tests/xmconfigdata/test-fullvirt-net-ioemu.cfg
 create mode 100644 tests/xmconfigdata/test-fullvirt-net-ioemu.xml
 create mode 100644 tests/xmconfigdata/test-fullvirt-net-netfront.cfg
 create mode 100644 tests/xmconfigdata/test-fullvirt-net-netfront.xml
 create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr
 create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.xml
 create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr
 create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-netfront.xml




More information about the libvir-list mailing list