fbe740
From 653245c4de76aba4e75131da8d40eed5b15ffd0d Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <653245c4de76aba4e75131da8d40eed5b15ffd0d@dist-git>
fbe740
From: Laine Stump <laine@redhat.com>
fbe740
Date: Thu, 30 Jan 2020 14:12:40 -0500
fbe740
Subject: [PATCH] conf: parse/format <teaming> subelement of <interface>
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
The subelement <teaming> of <interface> devices is used to configure a
fbe740
simple teaming association between two interfaces in a domain. Example:
fbe740
fbe740
  <interface type='bridge'>
fbe740
    <source bridge='br0'/>
fbe740
    <model type='virtio'/>
fbe740
    <mac address='00:11:22:33:44:55'/>
fbe740
    <alias name='ua-backup0'/>
fbe740
    <teaming type='persistent'/>
fbe740
  </interface>
fbe740
  <interface type='hostdev'>
fbe740
    <source>
fbe740
      <address type='pci' bus='0x02' slot='0x10' function='0x4'/>
fbe740
    </source>
fbe740
    <mac address='00:11:22:33:44:55'/>
fbe740
    <teaming type='transient' persistent='ua-backup0'/>
fbe740
  </interface>
fbe740
fbe740
The interface with <teaming type='persistent'/> is assumed to always
fbe740
be present, while the interface with type='transient' may be be
fbe740
unplugged and later re-plugged; the persistent='blah' attribute (and
fbe740
in the one currently available implementation, also the matching MAC
fbe740
addresses) is what associates the two devices with each other. It is
fbe740
up to the hypervisor and the guest network drivers to determine what
fbe740
to do with this information.
fbe740
fbe740
Signed-off-by: Laine Stump <laine@redhat.com>
fbe740
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
fbe740
(cherry picked from commit fb0509d06ac57434c2edbd81ee63deb32a0e598a)
fbe740
fbe740
https://bugzilla.redhat.com/1693587
fbe740
Signed-off-by: Laine Stump <laine@redhat.com>
fbe740
Message-Id: <20200130191244.24174-3-laine@redhat.com>
fbe740
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
fbe740
---
fbe740
 docs/schemas/domaincommon.rng                 | 19 ++++++
fbe740
 src/conf/domain_conf.c                        | 47 +++++++++++++
fbe740
 src/conf/domain_conf.h                        | 14 ++++
fbe740
 .../net-virtio-teaming-network.xml            | 37 +++++++++++
fbe740
 tests/qemuxml2argvdata/net-virtio-teaming.xml | 50 ++++++++++++++
fbe740
 .../net-virtio-teaming-network.xml            | 51 ++++++++++++++
fbe740
 .../qemuxml2xmloutdata/net-virtio-teaming.xml | 66 +++++++++++++++++++
fbe740
 tests/qemuxml2xmltest.c                       |  6 ++
fbe740
 8 files changed, 290 insertions(+)
fbe740
 create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming-network.xml
fbe740
 create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming.xml
fbe740
 create mode 100644 tests/qemuxml2xmloutdata/net-virtio-teaming-network.xml
fbe740
 create mode 100644 tests/qemuxml2xmloutdata/net-virtio-teaming.xml
fbe740
fbe740
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
fbe740
index 76d94b156f..026e753567 100644
fbe740
--- a/docs/schemas/domaincommon.rng
fbe740
+++ b/docs/schemas/domaincommon.rng
fbe740
@@ -3158,6 +3158,25 @@
fbe740
       <optional>
fbe740
         <ref name="vlan"/>
fbe740
       </optional>
fbe740
+      <optional>
fbe740
+        <element name="teaming">
fbe740
+          <choice>
fbe740
+            <group>
fbe740
+              <attribute name="type">
fbe740
+                <value>persistent</value>
fbe740
+              </attribute>
fbe740
+            </group>
fbe740
+            <group>
fbe740
+              <attribute name="type">
fbe740
+                <value>transient</value>
fbe740
+              </attribute>
fbe740
+              <attribute name="persistent">
fbe740
+                <ref name="aliasName"/>
fbe740
+              </attribute>
fbe740
+            </group>
fbe740
+          </choice>
fbe740
+        </element>
fbe740
+      </optional>
fbe740
     </interleave>
fbe740
   </define>
fbe740
 
fbe740
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
fbe740
index 0478914c69..58f72b3b0f 100644
fbe740
--- a/src/conf/domain_conf.c
fbe740
+++ b/src/conf/domain_conf.c
fbe740
@@ -554,6 +554,13 @@ VIR_ENUM_IMPL(virDomainNetVirtioTxMode,
fbe740
               "timer",
fbe740
 );
fbe740
 
fbe740
+VIR_ENUM_IMPL(virDomainNetTeaming,
fbe740
+              VIR_DOMAIN_NET_TEAMING_TYPE_LAST,
fbe740
+              "none",
fbe740
+              "persistent",
fbe740
+              "transient",
fbe740
+);
fbe740
+
fbe740
 VIR_ENUM_IMPL(virDomainNetInterfaceLinkState,
fbe740
               VIR_DOMAIN_NET_INTERFACE_LINK_STATE_LAST,
fbe740
               "default",
fbe740
@@ -6276,6 +6283,21 @@ virDomainNetDefValidate(const virDomainNetDef *net)
fbe740
                        virDomainNetTypeToString(net->type));
fbe740
         return -1;
fbe740
     }
fbe740
+
fbe740
+    if (net->teaming.type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT) {
fbe740
+        if (!net->teaming.persistent) {
fbe740
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
fbe740
+                           _("teaming persistent attribute must be set if teaming type is 'transient'"));
fbe740
+            return -1;
fbe740
+        }
fbe740
+    } else {
fbe740
+        if (net->teaming.persistent) {
fbe740
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
fbe740
+                           _("teaming persistent attribute not allowed if teaming type is '%s'"),
fbe740
+                           virDomainNetTeamingTypeToString(net->teaming.type));
fbe740
+            return -1;
fbe740
+        }
fbe740
+    }
fbe740
     return 0;
fbe740
 }
fbe740
 
fbe740
@@ -11574,6 +11596,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
fbe740
     g_autofree char *vhostuser_type = NULL;
fbe740
     g_autofree char *trustGuestRxFilters = NULL;
fbe740
     g_autofree char *vhost_path = NULL;
fbe740
+    g_autofree char *teamingType = NULL;
fbe740
+    g_autofree char *teamingPersistent = NULL;
fbe740
     const char *prefix = xmlopt ? xmlopt->config.netPrefix : NULL;
fbe740
 
fbe740
     if (!(def = virDomainNetDefNew(xmlopt)))
fbe740
@@ -11775,6 +11799,10 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
fbe740
                 if (!vhost_path && (tmp = virXMLPropString(cur, "vhost")))
fbe740
                     vhost_path = virFileSanitizePath(tmp);
fbe740
                 VIR_FREE(tmp);
fbe740
+            } else if (virXMLNodeNameEqual(cur, "teaming") &&
fbe740
+                       !teamingType && !teamingPersistent) {
fbe740
+                teamingType = virXMLPropString(cur, "type");
fbe740
+                teamingPersistent =  virXMLPropString(cur, "persistent");
fbe740
             }
fbe740
         }
fbe740
         cur = cur->next;
fbe740
@@ -12296,6 +12324,19 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
fbe740
         }
fbe740
     }
fbe740
 
fbe740
+    if (teamingType) {
fbe740
+        int tmpTeaming;
fbe740
+
fbe740
+        if ((tmpTeaming = virDomainNetTeamingTypeFromString(teamingType)) <= 0) {
fbe740
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
fbe740
+                           _("unknown teaming type '%s'"),
fbe740
+                           teamingType);
fbe740
+            goto error;
fbe740
+        }
fbe740
+        def->teaming.type = tmpTeaming;
fbe740
+    }
fbe740
+    def->teaming.persistent = g_steal_pointer(&teamingPersistent);
fbe740
+
fbe740
     rv = virXPathULong("string(./tune/sndbuf)", ctxt, &def->tune.sndbuf);
fbe740
     if (rv >= 0) {
fbe740
         def->tune.sndbuf_specified = true;
fbe740
@@ -25741,6 +25782,12 @@ virDomainNetDefFormat(virBufferPtr buf,
fbe740
         virBufferAddLit(buf,   "</tune>\n");
fbe740
     }
fbe740
 
fbe740
+    if (def->teaming.type != VIR_DOMAIN_NET_TEAMING_TYPE_NONE) {
fbe740
+        virBufferAsprintf(buf, "
fbe740
+                          virDomainNetTeamingTypeToString(def->teaming.type));
fbe740
+        virBufferEscapeString(buf, " persistent='%s'", def->teaming.persistent);
fbe740
+        virBufferAddLit(buf, "/>\n");
fbe740
+    }
fbe740
     if (def->linkstate) {
fbe740
         virBufferAsprintf(buf, "<link state='%s'/>\n",
fbe740
                           virDomainNetInterfaceLinkStateTypeToString(def->linkstate));
fbe740
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
fbe740
index 6ae89fa498..ee8eb3ddc0 100644
fbe740
--- a/src/conf/domain_conf.h
fbe740
+++ b/src/conf/domain_conf.h
fbe740
@@ -884,6 +884,15 @@ typedef enum {
fbe740
     VIR_DOMAIN_NET_VIRTIO_TX_MODE_LAST
fbe740
 } virDomainNetVirtioTxModeType;
fbe740
 
fbe740
+/* the type of teaming device */
fbe740
+typedef enum {
fbe740
+    VIR_DOMAIN_NET_TEAMING_TYPE_NONE,
fbe740
+    VIR_DOMAIN_NET_TEAMING_TYPE_PERSISTENT,
fbe740
+    VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT,
fbe740
+
fbe740
+    VIR_DOMAIN_NET_TEAMING_TYPE_LAST
fbe740
+} virDomainNetTeamingType;
fbe740
+
fbe740
 /* link interface states */
fbe740
 typedef enum {
fbe740
         VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT = 0, /* Default link state (up) */
fbe740
@@ -958,6 +967,10 @@ struct _virDomainNetDef {
fbe740
         char *tap;
fbe740
         char *vhost;
fbe740
     } backend;
fbe740
+    struct {
fbe740
+        virDomainNetTeamingType type;
fbe740
+        char *persistent; /* alias name of persistent device */
fbe740
+    } teaming;
fbe740
     union {
fbe740
         virDomainChrSourceDefPtr vhostuser;
fbe740
         struct {
fbe740
@@ -3425,6 +3438,7 @@ VIR_ENUM_DECL(virDomainFSModel);
fbe740
 VIR_ENUM_DECL(virDomainNet);
fbe740
 VIR_ENUM_DECL(virDomainNetBackend);
fbe740
 VIR_ENUM_DECL(virDomainNetVirtioTxMode);
fbe740
+VIR_ENUM_DECL(virDomainNetTeaming);
fbe740
 VIR_ENUM_DECL(virDomainNetInterfaceLinkState);
fbe740
 VIR_ENUM_DECL(virDomainNetModel);
fbe740
 VIR_ENUM_DECL(virDomainChrDevice);
fbe740
diff --git a/tests/qemuxml2argvdata/net-virtio-teaming-network.xml b/tests/qemuxml2argvdata/net-virtio-teaming-network.xml
fbe740
new file mode 100644
fbe740
index 0000000000..edab52f3a1
fbe740
--- /dev/null
fbe740
+++ b/tests/qemuxml2argvdata/net-virtio-teaming-network.xml
fbe740
@@ -0,0 +1,37 @@
fbe740
+<domain type='qemu'>
fbe740
+  <name>QEMUGuest1</name>
fbe740
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
fbe740
+  <memory unit='KiB'>219100</memory>
fbe740
+  <currentMemory unit='KiB'>219100</currentMemory>
fbe740
+  <vcpu placement='static'>1</vcpu>
fbe740
+  <os>
fbe740
+    <type arch='i686' machine='pc'>hvm</type>
fbe740
+    <boot dev='hd'/>
fbe740
+  </os>
fbe740
+  <clock offset='utc'/>
fbe740
+  <on_poweroff>destroy</on_poweroff>
fbe740
+  <on_reboot>restart</on_reboot>
fbe740
+  <on_crash>destroy</on_crash>
fbe740
+  <devices>
fbe740
+    <emulator>/usr/bin/qemu-system-i386</emulator>
fbe740
+    <disk type='block' device='disk'>
fbe740
+      <source dev='/dev/HostVG/QEMUGuest1'/>
fbe740
+      <target dev='hda' bus='ide'/>
fbe740
+    </disk>
fbe740
+    <controller type='usb' index='0'/>
fbe740
+    <interface type='network'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <source network='mybridge'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='persistent'/>
fbe740
+      <alias name='ua-backup0'/>
fbe740
+    </interface>
fbe740
+    <interface type='network'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <source network='myhostdevpool'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='transient' persistent='ua-backup0'/>
fbe740
+    </interface>
fbe740
+    <memballoon model='virtio'/>
fbe740
+  </devices>
fbe740
+</domain>
fbe740
diff --git a/tests/qemuxml2argvdata/net-virtio-teaming.xml b/tests/qemuxml2argvdata/net-virtio-teaming.xml
fbe740
new file mode 100644
fbe740
index 0000000000..830ce28524
fbe740
--- /dev/null
fbe740
+++ b/tests/qemuxml2argvdata/net-virtio-teaming.xml
fbe740
@@ -0,0 +1,50 @@
fbe740
+<domain type='qemu'>
fbe740
+  <name>QEMUGuest1</name>
fbe740
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
fbe740
+  <memory unit='KiB'>219100</memory>
fbe740
+  <currentMemory unit='KiB'>219100</currentMemory>
fbe740
+  <vcpu placement='static'>1</vcpu>
fbe740
+  <os>
fbe740
+    <type arch='i686' machine='pc'>hvm</type>
fbe740
+    <boot dev='hd'/>
fbe740
+  </os>
fbe740
+  <clock offset='utc'/>
fbe740
+  <on_poweroff>destroy</on_poweroff>
fbe740
+  <on_reboot>restart</on_reboot>
fbe740
+  <on_crash>destroy</on_crash>
fbe740
+  <devices>
fbe740
+    <emulator>/usr/bin/qemu-system-i386</emulator>
fbe740
+    <disk type='block' device='disk'>
fbe740
+      <source dev='/dev/HostVG/QEMUGuest1'/>
fbe740
+      <target dev='hda' bus='ide'/>
fbe740
+    </disk>
fbe740
+    <controller type='usb' index='0'/>
fbe740
+    <interface type='user'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='persistent'/>
fbe740
+      <alias name='ua-backup0'/>
fbe740
+    </interface>
fbe740
+    <interface type='user'>
fbe740
+      <mac address='66:44:33:22:11:00'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='persistent'/>
fbe740
+      <alias name='ua-backup1'/>
fbe740
+    </interface>
fbe740
+    <interface type='hostdev' managed='yes'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <source>
fbe740
+        <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x1'/>
fbe740
+      </source>
fbe740
+      <teaming type='transient' persistent='ua-backup0'/>
fbe740
+    </interface>
fbe740
+    <interface type='hostdev' managed='yes'>
fbe740
+      <mac address='66:44:33:22:11:00'/>
fbe740
+      <source>
fbe740
+        <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x2'/>
fbe740
+      </source>
fbe740
+      <teaming type='transient' persistent='ua-backup1'/>
fbe740
+    </interface>
fbe740
+    <memballoon model='virtio'/>
fbe740
+  </devices>
fbe740
+</domain>
fbe740
diff --git a/tests/qemuxml2xmloutdata/net-virtio-teaming-network.xml b/tests/qemuxml2xmloutdata/net-virtio-teaming-network.xml
fbe740
new file mode 100644
fbe740
index 0000000000..e0dbeafe02
fbe740
--- /dev/null
fbe740
+++ b/tests/qemuxml2xmloutdata/net-virtio-teaming-network.xml
fbe740
@@ -0,0 +1,51 @@
fbe740
+<domain type='qemu'>
fbe740
+  <name>QEMUGuest1</name>
fbe740
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
fbe740
+  <memory unit='KiB'>219100</memory>
fbe740
+  <currentMemory unit='KiB'>219100</currentMemory>
fbe740
+  <vcpu placement='static'>1</vcpu>
fbe740
+  <os>
fbe740
+    <type arch='i686' machine='pc'>hvm</type>
fbe740
+    <boot dev='hd'/>
fbe740
+  </os>
fbe740
+  <clock offset='utc'/>
fbe740
+  <on_poweroff>destroy</on_poweroff>
fbe740
+  <on_reboot>restart</on_reboot>
fbe740
+  <on_crash>destroy</on_crash>
fbe740
+  <devices>
fbe740
+    <emulator>/usr/bin/qemu-system-i386</emulator>
fbe740
+    <disk type='block' device='disk'>
fbe740
+      <driver name='qemu' type='raw'/>
fbe740
+      <source dev='/dev/HostVG/QEMUGuest1'/>
fbe740
+      <target dev='hda' bus='ide'/>
fbe740
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
fbe740
+    </disk>
fbe740
+    <controller type='usb' index='0'>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
fbe740
+    </controller>
fbe740
+    <controller type='pci' index='0' model='pci-root'/>
fbe740
+    <controller type='ide' index='0'>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
fbe740
+    </controller>
fbe740
+    <interface type='network'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <source network='mybridge'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='persistent'/>
fbe740
+      <alias name='ua-backup0'/>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
fbe740
+    </interface>
fbe740
+    <interface type='network'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <source network='myhostdevpool'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='transient' persistent='ua-backup0'/>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
fbe740
+    </interface>
fbe740
+    <input type='mouse' bus='ps2'/>
fbe740
+    <input type='keyboard' bus='ps2'/>
fbe740
+    <memballoon model='virtio'>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
fbe740
+    </memballoon>
fbe740
+  </devices>
fbe740
+</domain>
fbe740
diff --git a/tests/qemuxml2xmloutdata/net-virtio-teaming.xml b/tests/qemuxml2xmloutdata/net-virtio-teaming.xml
fbe740
new file mode 100644
fbe740
index 0000000000..5a5695794a
fbe740
--- /dev/null
fbe740
+++ b/tests/qemuxml2xmloutdata/net-virtio-teaming.xml
fbe740
@@ -0,0 +1,66 @@
fbe740
+<domain type='qemu'>
fbe740
+  <name>QEMUGuest1</name>
fbe740
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
fbe740
+  <memory unit='KiB'>219100</memory>
fbe740
+  <currentMemory unit='KiB'>219100</currentMemory>
fbe740
+  <vcpu placement='static'>1</vcpu>
fbe740
+  <os>
fbe740
+    <type arch='i686' machine='pc'>hvm</type>
fbe740
+    <boot dev='hd'/>
fbe740
+  </os>
fbe740
+  <clock offset='utc'/>
fbe740
+  <on_poweroff>destroy</on_poweroff>
fbe740
+  <on_reboot>restart</on_reboot>
fbe740
+  <on_crash>destroy</on_crash>
fbe740
+  <devices>
fbe740
+    <emulator>/usr/bin/qemu-system-i386</emulator>
fbe740
+    <disk type='block' device='disk'>
fbe740
+      <driver name='qemu' type='raw'/>
fbe740
+      <source dev='/dev/HostVG/QEMUGuest1'/>
fbe740
+      <target dev='hda' bus='ide'/>
fbe740
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
fbe740
+    </disk>
fbe740
+    <controller type='usb' index='0'>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
fbe740
+    </controller>
fbe740
+    <controller type='pci' index='0' model='pci-root'/>
fbe740
+    <controller type='ide' index='0'>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
fbe740
+    </controller>
fbe740
+    <interface type='user'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='persistent'/>
fbe740
+      <alias name='ua-backup0'/>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
fbe740
+    </interface>
fbe740
+    <interface type='user'>
fbe740
+      <mac address='66:44:33:22:11:00'/>
fbe740
+      <model type='virtio'/>
fbe740
+      <teaming type='persistent'/>
fbe740
+      <alias name='ua-backup1'/>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
fbe740
+    </interface>
fbe740
+    <interface type='hostdev' managed='yes'>
fbe740
+      <mac address='00:11:22:33:44:55'/>
fbe740
+      <source>
fbe740
+        <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x1'/>
fbe740
+      </source>
fbe740
+      <teaming type='transient' persistent='ua-backup0'/>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
fbe740
+    </interface>
fbe740
+    <interface type='hostdev' managed='yes'>
fbe740
+      <mac address='66:44:33:22:11:00'/>
fbe740
+      <source>
fbe740
+        <address type='pci' domain='0x0000' bus='0x03' slot='0x07' function='0x2'/>
fbe740
+      </source>
fbe740
+      <teaming type='transient' persistent='ua-backup1'/>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
fbe740
+    </interface>
fbe740
+    <input type='mouse' bus='ps2'/>
fbe740
+    <input type='keyboard' bus='ps2'/>
fbe740
+    <memballoon model='virtio'>
fbe740
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
fbe740
+    </memballoon>
fbe740
+  </devices>
fbe740
+</domain>
fbe740
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
fbe740
index 3cefc64833..e54c540ef6 100644
fbe740
--- a/tests/qemuxml2xmltest.c
fbe740
+++ b/tests/qemuxml2xmltest.c
fbe740
@@ -451,6 +451,12 @@ mymain(void)
fbe740
     DO_TEST("net-eth-unmanaged-tap", NONE);
fbe740
     DO_TEST("net-virtio-network-portgroup", NONE);
fbe740
     DO_TEST("net-virtio-rxtxqueuesize", NONE);
fbe740
+    DO_TEST("net-virtio-teaming",
fbe740
+            QEMU_CAPS_VIRTIO_NET_FAILOVER,
fbe740
+            QEMU_CAPS_DEVICE_VFIO_PCI);
fbe740
+    DO_TEST("net-virtio-teaming-network",
fbe740
+            QEMU_CAPS_VIRTIO_NET_FAILOVER,
fbe740
+            QEMU_CAPS_DEVICE_VFIO_PCI);
fbe740
     DO_TEST("net-hostdev", NONE);
fbe740
     DO_TEST("net-hostdev-bootorder", NONE);
fbe740
     DO_TEST("net-hostdev-vfio", QEMU_CAPS_DEVICE_VFIO_PCI);
fbe740
-- 
fbe740
2.25.0
fbe740