[PATCH 0/7] support <teaming> (aka "QEMU virtio failover") with plain <hostdev>

Laine Stump posted 7 patches 3 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210211075734.340526-1-laine@redhat.com
NEWS.rst                                      |  6 ++
docs/formatdomain.rst                         | 51 +++++++++++
docs/schemas/domaincommon.rng                 | 42 +++++----
src/conf/domain_conf.c                        | 87 +++++++++++++------
src/conf/domain_conf.h                        | 13 ++-
src/conf/domain_validate.c                    | 45 +++++++---
src/conf/virconftypes.h                       |  3 +
src/libvirt_private.syms                      |  1 +
src/qemu/qemu_command.c                       | 17 ++--
src/qemu/qemu_domain.c                        |  2 +-
src/qemu/qemu_migration.c                     |  4 +-
src/qemu/qemu_validate.c                      | 42 ++++-----
.../net-virtio-teaming-hostdev.args           | 40 +++++++++
.../net-virtio-teaming-hostdev.xml            | 48 ++++++++++
tests/qemuxml2argvtest.c                      |  3 +
.../net-virtio-teaming-hostdev.xml            | 64 ++++++++++++++
tests/qemuxml2xmltest.c                       |  3 +
17 files changed, 384 insertions(+), 87 deletions(-)
create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-hostdev.args
create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-hostdev.xml
create mode 100644 tests/qemuxml2xmloutdata/net-virtio-teaming-hostdev.xml
[PATCH 0/7] support <teaming> (aka "QEMU virtio failover") with plain <hostdev>
Posted by Laine Stump 3 years, 2 months ago
This is explained in excruciating detail in Patch 5, but in short,
allowing the <teaming> element to be in a plain <hostdev> will permit
someone who is running libvirt unprivileged, or in a container with no
access to a PF device, to use the <teaming> feature, which
encapsulates a lot of functionality related to assigning an SRIOV
network device to a guest as a part of a failover bond device (the
other device in the pair is an emulated virtio NIC), which in turn
permits the guest to be migrated by transparently unplugging the SRIOV
NIC prior to migration, and plugging a new one in after migration is
completed.

(Previously we required <interface type='hostdev'> for this feature,
but that type of device needs to send netlink messages to the PF of
the SRIOV VF that's being assigned, and that simply isn't possible
sometimes.)

Laine Stump (7):
  conf: make teaming info an official type
  conf: use virDomainNetTeamingInfoPtr instead of
    virDomainNetTeamingInfo
  conf: separate Parse/Format functions for virDomainNetTeamingInfo
  schema: separate teaming element definition from interface element
  conf: parse/format <teaming> element in plain <hostdev>
  qemu: plug <teaming> config from <hostdev> into qemu commandline
  news: document support for <teaming> in <hostdev>

 NEWS.rst                                      |  6 ++
 docs/formatdomain.rst                         | 51 +++++++++++
 docs/schemas/domaincommon.rng                 | 42 +++++----
 src/conf/domain_conf.c                        | 87 +++++++++++++------
 src/conf/domain_conf.h                        | 13 ++-
 src/conf/domain_validate.c                    | 45 +++++++---
 src/conf/virconftypes.h                       |  3 +
 src/libvirt_private.syms                      |  1 +
 src/qemu/qemu_command.c                       | 17 ++--
 src/qemu/qemu_domain.c                        |  2 +-
 src/qemu/qemu_migration.c                     |  4 +-
 src/qemu/qemu_validate.c                      | 42 ++++-----
 .../net-virtio-teaming-hostdev.args           | 40 +++++++++
 .../net-virtio-teaming-hostdev.xml            | 48 ++++++++++
 tests/qemuxml2argvtest.c                      |  3 +
 .../net-virtio-teaming-hostdev.xml            | 64 ++++++++++++++
 tests/qemuxml2xmltest.c                       |  3 +
 17 files changed, 384 insertions(+), 87 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-hostdev.args
 create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-hostdev.xml
 create mode 100644 tests/qemuxml2xmloutdata/net-virtio-teaming-hostdev.xml

-- 
2.29.2

Re: [PATCH 0/7] support <teaming> (aka "QEMU virtio failover") with plain <hostdev>
Posted by Michal Privoznik 3 years, 2 months ago
On 2/11/21 8:57 AM, Laine Stump wrote:
> This is explained in excruciating detail in Patch 5, but in short,
> allowing the <teaming> element to be in a plain <hostdev> will permit
> someone who is running libvirt unprivileged, or in a container with no
> access to a PF device, to use the <teaming> feature, which
> encapsulates a lot of functionality related to assigning an SRIOV
> network device to a guest as a part of a failover bond device (the
> other device in the pair is an emulated virtio NIC), which in turn
> permits the guest to be migrated by transparently unplugging the SRIOV
> NIC prior to migration, and plugging a new one in after migration is
> completed.
> 
> (Previously we required <interface type='hostdev'> for this feature,
> but that type of device needs to send netlink messages to the PF of
> the SRIOV VF that's being assigned, and that simply isn't possible
> sometimes.)
> 
> Laine Stump (7):
>    conf: make teaming info an official type
>    conf: use virDomainNetTeamingInfoPtr instead of
>      virDomainNetTeamingInfo
>    conf: separate Parse/Format functions for virDomainNetTeamingInfo
>    schema: separate teaming element definition from interface element
>    conf: parse/format <teaming> element in plain <hostdev>
>    qemu: plug <teaming> config from <hostdev> into qemu commandline
>    news: document support for <teaming> in <hostdev>
> 
>   NEWS.rst                                      |  6 ++
>   docs/formatdomain.rst                         | 51 +++++++++++
>   docs/schemas/domaincommon.rng                 | 42 +++++----
>   src/conf/domain_conf.c                        | 87 +++++++++++++------
>   src/conf/domain_conf.h                        | 13 ++-
>   src/conf/domain_validate.c                    | 45 +++++++---
>   src/conf/virconftypes.h                       |  3 +
>   src/libvirt_private.syms                      |  1 +
>   src/qemu/qemu_command.c                       | 17 ++--
>   src/qemu/qemu_domain.c                        |  2 +-
>   src/qemu/qemu_migration.c                     |  4 +-
>   src/qemu/qemu_validate.c                      | 42 ++++-----
>   .../net-virtio-teaming-hostdev.args           | 40 +++++++++
>   .../net-virtio-teaming-hostdev.xml            | 48 ++++++++++
>   tests/qemuxml2argvtest.c                      |  3 +
>   .../net-virtio-teaming-hostdev.xml            | 64 ++++++++++++++
>   tests/qemuxml2xmltest.c                       |  3 +
>   17 files changed, 384 insertions(+), 87 deletions(-)
>   create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-hostdev.args
>   create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-hostdev.xml
>   create mode 100644 tests/qemuxml2xmloutdata/net-virtio-teaming-hostdev.xml
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal