render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
c480ed
From 37f8c26d43550986a8c6467aef4bf9d1ebe3a683 Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <37f8c26d43550986a8c6467aef4bf9d1ebe3a683@dist-git>
c480ed
From: Yi Min Zhao <zyimin@linux.ibm.com>
c480ed
Date: Mon, 8 Apr 2019 10:57:28 +0200
c480ed
Subject: [PATCH] qemu: Generate and use zPCI device in QEMU command line
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
Add new functions to generate zPCI command string and append it to
c480ed
QEMU command line. And the related tests are added.
c480ed
c480ed
Signed-off-by: Yi Min Zhao <zyimin@linux.ibm.com>
c480ed
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
c480ed
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
c480ed
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
c480ed
c480ed
(cherry picked from commit 9d6be3ff79b4ce7588e2842d4a6c3e713a97a7ec)
c480ed
c480ed
https://bugzilla.redhat.com/show_bug.cgi?id=1508149
c480ed
c480ed
Conflicts:
c480ed
c480ed
  * src/qemu/qemu_command.c
c480ed
    + context in qemuBuildInterfaceCommandLine()
c480ed
      - missing 4de4e4bc9911
c480ed
    + context in qemuBuildDiskCommandLine()
c480ed
      - missing b8936d265518
c480ed
c480ed
  * tests/qemuxml2argvdata/hostdev-vfio-zpci.args
c480ed
    + no -boot in output
c480ed
      - missing caccbba64aa9
c480ed
c480ed
Changes
c480ed
c480ed
  * tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
c480ed
    tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
c480ed
    tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
c480ed
    + no -boot in output
c480ed
      - missing caccbba64aa9
c480ed
c480ed
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
c480ed
Message-Id: <20190408085732.28684-12-abologna@redhat.com>
c480ed
Reviewed-by: Laine Stump <laine@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/qemu/qemu_command.c                       | 104 ++++++++++++++++++
c480ed
 src/qemu/qemu_command.h                       |   2 +
c480ed
 .../disk-virtio-s390-zpci.args                |   1 +
c480ed
 .../hostdev-vfio-zpci-autogenerate.args       |  26 +++++
c480ed
 .../hostdev-vfio-zpci-autogenerate.xml        |  18 +++
c480ed
 .../hostdev-vfio-zpci-boundaries.args         |  30 +++++
c480ed
 .../hostdev-vfio-zpci-boundaries.xml          |  30 +++++
c480ed
 .../hostdev-vfio-zpci-multidomain-many.args   |  40 +++++++
c480ed
 .../hostdev-vfio-zpci-multidomain-many.xml    |  79 +++++++++++++
c480ed
 tests/qemuxml2argvdata/hostdev-vfio-zpci.args |   2 +
c480ed
 tests/qemuxml2argvtest.c                      |  13 +++
c480ed
 .../hostdev-vfio-zpci-autogenerate.xml        |  34 ++++++
c480ed
 .../hostdev-vfio-zpci-boundaries.xml          |  48 ++++++++
c480ed
 .../hostdev-vfio-zpci-multidomain-many.xml    |  97 ++++++++++++++++
c480ed
 tests/qemuxml2xmltest.c                       |  11 ++
c480ed
 15 files changed, 535 insertions(+)
c480ed
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
c480ed
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
c480ed
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
c480ed
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
c480ed
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
c480ed
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
c480ed
 create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci-autogenerate.xml
c480ed
 create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.xml
c480ed
 create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci-multidomain-many.xml
c480ed
c480ed
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
c480ed
index a8c832bad8..c06f396b44 100644
c480ed
--- a/src/qemu/qemu_command.c
c480ed
+++ b/src/qemu/qemu_command.c
c480ed
@@ -2147,6 +2147,57 @@ qemuBuildDriveDevStr(const virDomainDef *def,
c480ed
     return NULL;
c480ed
 }
c480ed
 
c480ed
+char *
c480ed
+qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev)
c480ed
+{
c480ed
+    virBuffer buf = VIR_BUFFER_INITIALIZER;
c480ed
+
c480ed
+    virBufferAsprintf(&buf,
c480ed
+                      "zpci,uid=%u,fid=%u,target=%s,id=zpci%u",
c480ed
+                      dev->addr.pci.zpci.uid,
c480ed
+                      dev->addr.pci.zpci.fid,
c480ed
+                      dev->alias,
c480ed
+                      dev->addr.pci.zpci.uid);
c480ed
+
c480ed
+    if (virBufferCheckError(&buf) < 0) {
c480ed
+        virBufferFreeAndReset(&buf;;
c480ed
+        return NULL;
c480ed
+    }
c480ed
+
c480ed
+    return virBufferContentAndReset(&buf;;
c480ed
+}
c480ed
+
c480ed
+static int
c480ed
+qemuCommandAddZPCIDevice(virCommandPtr cmd,
c480ed
+                         virDomainDeviceInfoPtr dev)
c480ed
+{
c480ed
+    char *devstr = NULL;
c480ed
+
c480ed
+    virCommandAddArg(cmd, "-device");
c480ed
+
c480ed
+    if (!(devstr = qemuBuildZPCIDevStr(dev)))
c480ed
+        return -1;
c480ed
+
c480ed
+    virCommandAddArg(cmd, devstr);
c480ed
+
c480ed
+    VIR_FREE(devstr);
c480ed
+    return 0;
c480ed
+}
c480ed
+
c480ed
+static int
c480ed
+qemuCommandAddExtDevice(virCommandPtr cmd,
c480ed
+                        virDomainDeviceInfoPtr dev)
c480ed
+{
c480ed
+    if (dev->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI ||
c480ed
+        dev->addr.pci.extFlags == VIR_PCI_ADDRESS_EXTENSION_NONE) {
c480ed
+        return 0;
c480ed
+    }
c480ed
+
c480ed
+    if (dev->addr.pci.extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI)
c480ed
+        return qemuCommandAddZPCIDevice(cmd, dev);
c480ed
+
c480ed
+    return 0;
c480ed
+}
c480ed
 
c480ed
 static int
c480ed
 qemuBulildFloppyCommandLineOptions(virCommandPtr cmd,
c480ed
@@ -2267,6 +2318,9 @@ qemuBuildDiskCommandLine(virCommandPtr cmd,
c480ed
                                                    bootindex) < 0)
c480ed
                 return -1;
c480ed
         } else {
c480ed
+            if (qemuCommandAddExtDevice(cmd, &disk->info) < 0)
c480ed
+                return -1;
c480ed
+
c480ed
             virCommandAddArg(cmd, "-device");
c480ed
 
c480ed
             if (!(optstr = qemuBuildDriveDevStr(def, disk, bootindex,
c480ed
@@ -2466,6 +2520,9 @@ qemuBuildFSDevCommandLine(virCommandPtr cmd,
c480ed
         virCommandAddArg(cmd, optstr);
c480ed
         VIR_FREE(optstr);
c480ed
 
c480ed
+        if (qemuCommandAddExtDevice(cmd, &fs->info) < 0)
c480ed
+            return -1;
c480ed
+
c480ed
         virCommandAddArg(cmd, "-device");
c480ed
         if (!(optstr = qemuBuildFSDevStr(def, fs, qemuCaps)))
c480ed
             return -1;
c480ed
@@ -2950,6 +3007,11 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
c480ed
                 goto cleanup;
c480ed
 
c480ed
             if (devstr) {
c480ed
+                if (qemuCommandAddExtDevice(cmd, &cont->info) < 0) {
c480ed
+                    VIR_FREE(devstr);
c480ed
+                    goto cleanup;
c480ed
+                }
c480ed
+
c480ed
                 virCommandAddArg(cmd, "-device");
c480ed
                 virCommandAddArg(cmd, devstr);
c480ed
                 VIR_FREE(devstr);
c480ed
@@ -3753,6 +3815,9 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
c480ed
     if (!def->watchdog)
c480ed
         return 0;
c480ed
 
c480ed
+    if (qemuCommandAddExtDevice(cmd, &def->watchdog->info) < 0)
c480ed
+        return -1;
c480ed
+
c480ed
     virCommandAddArg(cmd, "-device");
c480ed
 
c480ed
     optstr = qemuBuildWatchdogDevStr(def, watchdog, qemuCaps);
c480ed
@@ -3837,6 +3902,9 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
c480ed
     if (qemuBuildVirtioOptionsStr(&buf, def->memballoon->virtio, qemuCaps) < 0)
c480ed
         goto error;
c480ed
 
c480ed
+    if (qemuCommandAddExtDevice(cmd, &def->memballoon->info) < 0)
c480ed
+        goto error;
c480ed
+
c480ed
     virCommandAddArg(cmd, "-device");
c480ed
     virCommandAddArgBuffer(cmd, &buf;;
c480ed
     return 0;
c480ed
@@ -4059,6 +4127,9 @@ qemuBuildInputCommandLine(virCommandPtr cmd,
c480ed
         virDomainInputDefPtr input = def->inputs[i];
c480ed
         char *devstr = NULL;
c480ed
 
c480ed
+        if (qemuCommandAddExtDevice(cmd, &input->info) < 0)
c480ed
+            return -1;
c480ed
+
c480ed
         if (qemuBuildInputDevStr(&devstr, def, input, qemuCaps) < 0)
c480ed
             return -1;
c480ed
 
c480ed
@@ -4200,6 +4271,9 @@ qemuBuildSoundCommandLine(virCommandPtr cmd,
c480ed
         if (sound->model == VIR_DOMAIN_SOUND_MODEL_PCSPK) {
c480ed
             virCommandAddArgList(cmd, "-soundhw", "pcspk", NULL);
c480ed
         } else {
c480ed
+            if (qemuCommandAddExtDevice(cmd, &sound->info) < 0)
c480ed
+                return -1;
c480ed
+
c480ed
             virCommandAddArg(cmd, "-device");
c480ed
             if (!(str = qemuBuildSoundDevStr(def, sound, qemuCaps)))
c480ed
                 return -1;
c480ed
@@ -4439,6 +4513,10 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
c480ed
         if (video->primary) {
c480ed
             if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) {
c480ed
 
c480ed
+                if (qemuCommandAddExtDevice(cmd,
c480ed
+                                            &def->videos[i]->info) < 0)
c480ed
+                    return -1;
c480ed
+
c480ed
                 virCommandAddArg(cmd, "-device");
c480ed
 
c480ed
                 if (!(str = qemuBuildDeviceVideoStr(def, video, qemuCaps)))
c480ed
@@ -4451,6 +4529,9 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
c480ed
                     return -1;
c480ed
             }
c480ed
         } else {
c480ed
+            if (qemuCommandAddExtDevice(cmd, &def->videos[i]->info) < 0)
c480ed
+                return -1;
c480ed
+
c480ed
             virCommandAddArg(cmd, "-device");
c480ed
 
c480ed
             if (!(str = qemuBuildDeviceVideoStr(def, video, qemuCaps)))
c480ed
@@ -5328,6 +5409,10 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
c480ed
                                      VIR_COMMAND_PASS_FD_CLOSE_PARENT);
c480ed
                 }
c480ed
             }
c480ed
+
c480ed
+            if (qemuCommandAddExtDevice(cmd, hostdev->info) < 0)
c480ed
+                return -1;
c480ed
+
c480ed
             virCommandAddArg(cmd, "-device");
c480ed
             devstr = qemuBuildPCIHostdevDevStr(def, hostdev, bootIndex,
c480ed
                                                configfd_name, qemuCaps);
c480ed
@@ -5802,6 +5887,9 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager,
c480ed
         virCommandAddArgBuffer(cmd, &buf;;
c480ed
 
c480ed
         /* add the device */
c480ed
+        if (qemuCommandAddExtDevice(cmd, &rng->info) < 0)
c480ed
+            return -1;
c480ed
+
c480ed
         if (!(tmp = qemuBuildRNGDevStr(def, rng, qemuCaps)))
c480ed
             return -1;
c480ed
         virCommandAddArgList(cmd, "-device", tmp, NULL);
c480ed
@@ -8654,11 +8742,17 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
c480ed
      *   New way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
c480ed
      */
c480ed
     if (qemuDomainSupportsNicdev(def, net)) {
c480ed
+        if (qemuCommandAddExtDevice(cmd, &net->info) < 0)
c480ed
+            goto cleanup;
c480ed
+
c480ed
         if (!(nic = qemuBuildNicDevStr(def, net, bootindex,
c480ed
                                        vhostfdSize, qemuCaps)))
c480ed
             goto cleanup;
c480ed
         virCommandAddArgList(cmd, "-device", nic, NULL);
c480ed
     } else {
c480ed
+        if (qemuCommandAddExtDevice(cmd, &net->info) < 0)
c480ed
+            goto cleanup;
c480ed
+
c480ed
         if (!(nic = qemuBuildLegacyNicStr(net)))
c480ed
             goto cleanup;
c480ed
         virCommandAddArgList(cmd, "-net", nic, NULL);
c480ed
@@ -9105,6 +9199,12 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
c480ed
 
c480ed
     if (!devstr)
c480ed
         return -1;
c480ed
+
c480ed
+    if (qemuCommandAddExtDevice(cmd, &shmem->info) < 0) {
c480ed
+        VIR_FREE(devstr);
c480ed
+        return -1;
c480ed
+    }
c480ed
+
c480ed
     virCommandAddArgList(cmd, "-device", devstr, NULL);
c480ed
     VIR_FREE(devstr);
c480ed
 
c480ed
@@ -10259,6 +10359,10 @@ qemuBuildVsockCommandLine(virCommandPtr cmd,
c480ed
 
c480ed
     virCommandPassFD(cmd, priv->vhostfd, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
c480ed
     priv->vhostfd = -1;
c480ed
+
c480ed
+    if (qemuCommandAddExtDevice(cmd, &vsock->info) < 0)
c480ed
+        goto cleanup;
c480ed
+
c480ed
     virCommandAddArgList(cmd, "-device", devstr, NULL);
c480ed
 
c480ed
     ret = 0;
c480ed
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
c480ed
index 4f1b360130..e8cd8ed04e 100644
c480ed
--- a/src/qemu/qemu_command.h
c480ed
+++ b/src/qemu/qemu_command.h
c480ed
@@ -174,6 +174,8 @@ char *qemuBuildRedirdevDevStr(const virDomainDef *def,
c480ed
                               virDomainRedirdevDefPtr dev,
c480ed
                               virQEMUCapsPtr qemuCaps);
c480ed
 
c480ed
+char *qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev);
c480ed
+
c480ed
 int qemuNetworkPrepareDevices(virDomainDefPtr def);
c480ed
 
c480ed
 int qemuGetDriveSourceString(virStorageSourcePtr src,
c480ed
diff --git a/tests/qemuxml2argvdata/disk-virtio-s390-zpci.args b/tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
c480ed
index 20e63a15b5..ffb5d1597e 100644
c480ed
--- a/tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
c480ed
+++ b/tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
c480ed
@@ -21,6 +21,7 @@ server,nowait \
c480ed
 -no-shutdown \
c480ed
 -boot c \
c480ed
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
c480ed
+-device zpci,uid=25,fid=31,target=virtio-disk0,id=zpci25 \
c480ed
 -device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,\
c480ed
 id=virtio-disk0 \
c480ed
 -device virtio-balloon-ccw,id=balloon0,devno=fe.0.0000
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args b/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
c480ed
new file mode 100644
c480ed
index 0000000000..e5987e1053
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
c480ed
@@ -0,0 +1,26 @@
c480ed
+LC_ALL=C \
c480ed
+PATH=/bin \
c480ed
+HOME=/home/test \
c480ed
+USER=test \
c480ed
+LOGNAME=test \
c480ed
+QEMU_AUDIO_DRV=none \
c480ed
+/usr/bin/qemu-system-s390x \
c480ed
+-name QEMUGuest1 \
c480ed
+-S \
c480ed
+-machine s390-ccw-virtio,accel=tcg,usb=off,dump-guest-core=off \
c480ed
+-m 214 \
c480ed
+-smp 1,sockets=1,cores=1,threads=1 \
c480ed
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
c480ed
+-display none \
c480ed
+-no-user-config \
c480ed
+-nodefaults \
c480ed
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
c480ed
+server,nowait \
c480ed
+-mon chardev=charmonitor,id=monitor,mode=control \
c480ed
+-rtc base=utc \
c480ed
+-no-shutdown \
c480ed
+-boot c \
c480ed
+-device zpci,uid=1,fid=0,target=hostdev0,id=zpci1 \
c480ed
+-device vfio-pci,host=00:00.0,id=hostdev0,bus=pci.0,addr=0x1 \
c480ed
+-device zpci,uid=2,fid=1,target=balloon0,id=zpci2 \
c480ed
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml b/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
c480ed
new file mode 100644
c480ed
index 0000000000..36161006ab
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
c480ed
@@ -0,0 +1,18 @@
c480ed
+<domain type='qemu'>
c480ed
+  <name>QEMUGuest1</name>
c480ed
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
c480ed
+  <memory>219100</memory>
c480ed
+  <os>
c480ed
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
c480ed
+  </os>
c480ed
+  <devices>
c480ed
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci'/>
c480ed
+    </hostdev>
c480ed
+  </devices>
c480ed
+</domain>
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args b/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
c480ed
new file mode 100644
c480ed
index 0000000000..dcbb179a7d
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
c480ed
@@ -0,0 +1,30 @@
c480ed
+LC_ALL=C \
c480ed
+PATH=/bin \
c480ed
+HOME=/home/test \
c480ed
+USER=test \
c480ed
+LOGNAME=test \
c480ed
+QEMU_AUDIO_DRV=none \
c480ed
+/usr/bin/qemu-system-s390x \
c480ed
+-name QEMUGuest1 \
c480ed
+-S \
c480ed
+-machine s390-ccw-virtio,accel=tcg,usb=off,dump-guest-core=off \
c480ed
+-m 214 \
c480ed
+-smp 1,sockets=1,cores=1,threads=1 \
c480ed
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
c480ed
+-display none \
c480ed
+-no-user-config \
c480ed
+-nodefaults \
c480ed
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
c480ed
+server,nowait \
c480ed
+-mon chardev=charmonitor,id=monitor,mode=control \
c480ed
+-rtc base=utc \
c480ed
+-no-shutdown \
c480ed
+-boot c \
c480ed
+-device zpci,uid=3,fid=2,target=pci.1,id=zpci3 \
c480ed
+-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x1 \
c480ed
+-device zpci,uid=65535,fid=4294967295,target=hostdev0,id=zpci65535 \
c480ed
+-device vfio-pci,host=ffff:00:00.0,id=hostdev0,bus=pci.1,addr=0x1f \
c480ed
+-device zpci,uid=1,fid=0,target=hostdev1,id=zpci1 \
c480ed
+-device vfio-pci,host=00:00.0,id=hostdev1,bus=pci.0,addr=0x2 \
c480ed
+-device zpci,uid=2,fid=1,target=balloon0,id=zpci2 \
c480ed
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml b/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
c480ed
new file mode 100644
c480ed
index 0000000000..1e6060345b
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
c480ed
@@ -0,0 +1,30 @@
c480ed
+<domain type='qemu'>
c480ed
+  <name>QEMUGuest1</name>
c480ed
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
c480ed
+  <memory>219100</memory>
c480ed
+  <os>
c480ed
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
c480ed
+  </os>
c480ed
+  <devices>
c480ed
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
c480ed
+    <controller type='pci' index='0' model='pci-root'/>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0xffff' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x1f' function='0x0'>
c480ed
+        <zpci uid='0xffff' fid='0xffffffff'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci'>
c480ed
+        <zpci uid='0x0001' fid='0x00000000'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+  </devices>
c480ed
+</domain>
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args b/tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
c480ed
new file mode 100644
c480ed
index 0000000000..11a2e50f1e
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
c480ed
@@ -0,0 +1,40 @@
c480ed
+LC_ALL=C \
c480ed
+PATH=/bin \
c480ed
+HOME=/home/test \
c480ed
+USER=test \
c480ed
+LOGNAME=test \
c480ed
+QEMU_AUDIO_DRV=none \
c480ed
+/usr/bin/qemu-system-s390x \
c480ed
+-name QEMUGuest1 \
c480ed
+-S \
c480ed
+-machine s390-ccw-virtio,accel=tcg,usb=off,dump-guest-core=off \
c480ed
+-m 214 \
c480ed
+-smp 1,sockets=1,cores=1,threads=1 \
c480ed
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
c480ed
+-display none \
c480ed
+-no-user-config \
c480ed
+-nodefaults \
c480ed
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
c480ed
+server,nowait \
c480ed
+-mon chardev=charmonitor,id=monitor,mode=control \
c480ed
+-rtc base=utc \
c480ed
+-no-shutdown \
c480ed
+-boot c \
c480ed
+-device zpci,uid=35,fid=63,target=hostdev0,id=zpci35 \
c480ed
+-device vfio-pci,host=0001:00:00.0,id=hostdev0,bus=pci.0,addr=0x3 \
c480ed
+-device zpci,uid=53,fid=104,target=hostdev1,id=zpci53 \
c480ed
+-device vfio-pci,host=0002:00:00.0,id=hostdev1,bus=pci.0,addr=0x1 \
c480ed
+-device zpci,uid=1,fid=1,target=hostdev2,id=zpci1 \
c480ed
+-device vfio-pci,host=0003:00:00.0,id=hostdev2,bus=pci.0,addr=0x2 \
c480ed
+-device zpci,uid=2,fid=2,target=hostdev3,id=zpci2 \
c480ed
+-device vfio-pci,host=0004:00:00.0,id=hostdev3,bus=pci.0,addr=0x5 \
c480ed
+-device zpci,uid=83,fid=0,target=hostdev4,id=zpci83 \
c480ed
+-device vfio-pci,host=0005:00:00.0,id=hostdev4,bus=pci.0,addr=0x7 \
c480ed
+-device zpci,uid=3,fid=114,target=hostdev5,id=zpci3 \
c480ed
+-device vfio-pci,host=0006:00:00.0,id=hostdev5,bus=pci.0,addr=0x9 \
c480ed
+-device zpci,uid=23,fid=3,target=hostdev6,id=zpci23 \
c480ed
+-device vfio-pci,host=0007:00:00.0,id=hostdev6,bus=pci.0,addr=0x4 \
c480ed
+-device zpci,uid=4,fid=40,target=hostdev7,id=zpci4 \
c480ed
+-device vfio-pci,host=0008:00:00.0,id=hostdev7,bus=pci.0,addr=0x6 \
c480ed
+-device zpci,uid=5,fid=4,target=balloon0,id=zpci5 \
c480ed
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml b/tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
c480ed
new file mode 100644
c480ed
index 0000000000..da8305dd6d
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
c480ed
@@ -0,0 +1,79 @@
c480ed
+<domain type='qemu'>
c480ed
+  <name>QEMUGuest1</name>
c480ed
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
c480ed
+  <memory>219100</memory>
c480ed
+  <os>
c480ed
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
c480ed
+  </os>
c480ed
+  <devices>
c480ed
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
c480ed
+    <controller type='pci' index='0' model='pci-root'/>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'>
c480ed
+        <zpci uid='0x0023' fid='0x0000003f'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0002' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci'>
c480ed
+        <zpci uid='0x0035' fid='0x00000068'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0003' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0004' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0005' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'>
c480ed
+        <zpci uid='0x0053'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0006' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'>
c480ed
+        <zpci uid='0x0003' fid='0x00000072'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0007' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci'>
c480ed
+        <zpci uid='0x0017' fid='0x00000003'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0008' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci'>
c480ed
+        <zpci uid='0x0004' fid='0x00000028'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+  </devices>
c480ed
+</domain>
c480ed
diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci.args b/tests/qemuxml2argvdata/hostdev-vfio-zpci.args
c480ed
index 622c504da0..80de60acaa 100644
c480ed
--- a/tests/qemuxml2argvdata/hostdev-vfio-zpci.args
c480ed
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci.args
c480ed
@@ -20,5 +20,7 @@ server,nowait \
c480ed
 -rtc base=utc \
c480ed
 -no-shutdown \
c480ed
 -boot c \
c480ed
+-device zpci,uid=25,fid=31,target=hostdev0,id=zpci25 \
c480ed
 -device vfio-pci,host=00:00.0,id=hostdev0,bus=pci.0,addr=0x8 \
c480ed
+-device zpci,uid=1,fid=0,target=balloon0,id=zpci1 \
c480ed
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x1
c480ed
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
c480ed
index 1066de8bc4..9de0cbf7e9 100644
c480ed
--- a/tests/qemuxml2argvtest.c
c480ed
+++ b/tests/qemuxml2argvtest.c
c480ed
@@ -1637,6 +1637,19 @@ mymain(void)
c480ed
     DO_TEST("hostdev-vfio-zpci",
c480ed
             QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
             QEMU_CAPS_DEVICE_ZPCI);
c480ed
+    DO_TEST("hostdev-vfio-zpci-multidomain-many",
c480ed
+            QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
c480ed
+            QEMU_CAPS_DEVICE_ZPCI);
c480ed
+    DO_TEST("hostdev-vfio-zpci-autogenerate",
c480ed
+            QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
+            QEMU_CAPS_DEVICE_ZPCI);
c480ed
+    DO_TEST("hostdev-vfio-zpci-boundaries",
c480ed
+            QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
c480ed
+            QEMU_CAPS_DEVICE_ZPCI);
c480ed
+    DO_TEST_PARSE_ERROR("hostdev-vfio-zpci",
c480ed
+                        QEMU_CAPS_DEVICE_VFIO_PCI);
c480ed
     DO_TEST("pci-rom", NONE);
c480ed
     DO_TEST("pci-rom-disabled", NONE);
c480ed
     DO_TEST("pci-rom-disabled-invalid", NONE);
c480ed
diff --git a/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-autogenerate.xml b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-autogenerate.xml
c480ed
new file mode 100644
c480ed
index 0000000000..e94e63bd0a
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-autogenerate.xml
c480ed
@@ -0,0 +1,34 @@
c480ed
+<domain type='qemu'>
c480ed
+  <name>QEMUGuest1</name>
c480ed
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
c480ed
+  <memory unit='KiB'>219100</memory>
c480ed
+  <currentMemory unit='KiB'>219100</currentMemory>
c480ed
+  <vcpu placement='static'>1</vcpu>
c480ed
+  <os>
c480ed
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
c480ed
+    <boot dev='hd'/>
c480ed
+  </os>
c480ed
+  <clock offset='utc'/>
c480ed
+  <on_poweroff>destroy</on_poweroff>
c480ed
+  <on_reboot>restart</on_reboot>
c480ed
+  <on_crash>destroy</on_crash>
c480ed
+  <devices>
c480ed
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
c480ed
+    <controller type='pci' index='0' model='pci-root'/>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'>
c480ed
+        <zpci uid='0x0001' fid='0x00000000'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <memballoon model='virtio'>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'>
c480ed
+        <zpci uid='0x0002' fid='0x00000001'/>
c480ed
+      </address>
c480ed
+    </memballoon>
c480ed
+    <panic model='s390'/>
c480ed
+  </devices>
c480ed
+</domain>
c480ed
diff --git a/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.xml b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.xml
c480ed
new file mode 100644
c480ed
index 0000000000..81d2146188
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.xml
c480ed
@@ -0,0 +1,48 @@
c480ed
+<domain type='qemu'>
c480ed
+  <name>QEMUGuest1</name>
c480ed
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
c480ed
+  <memory unit='KiB'>219100</memory>
c480ed
+  <currentMemory unit='KiB'>219100</currentMemory>
c480ed
+  <vcpu placement='static'>1</vcpu>
c480ed
+  <os>
c480ed
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
c480ed
+    <boot dev='hd'/>
c480ed
+  </os>
c480ed
+  <clock offset='utc'/>
c480ed
+  <on_poweroff>destroy</on_poweroff>
c480ed
+  <on_reboot>restart</on_reboot>
c480ed
+  <on_crash>destroy</on_crash>
c480ed
+  <devices>
c480ed
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
c480ed
+    <controller type='pci' index='0' model='pci-root'/>
c480ed
+    <controller type='pci' index='1' model='pci-bridge'>
c480ed
+      <model name='pci-bridge'/>
c480ed
+      <target chassisNr='1'/>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
c480ed
+    </controller>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0xffff' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x1f' function='0x0'>
c480ed
+        <zpci uid='0xffff' fid='0xffffffff'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'>
c480ed
+        <zpci uid='0x0001' fid='0x00000000'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <memballoon model='virtio'>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'>
c480ed
+        <zpci uid='0x0002' fid='0x00000001'/>
c480ed
+      </address>
c480ed
+    </memballoon>
c480ed
+    <panic model='s390'/>
c480ed
+  </devices>
c480ed
+</domain>
c480ed
diff --git a/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-multidomain-many.xml b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-multidomain-many.xml
c480ed
new file mode 100644
c480ed
index 0000000000..e56106d103
c480ed
--- /dev/null
c480ed
+++ b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-multidomain-many.xml
c480ed
@@ -0,0 +1,97 @@
c480ed
+<domain type='qemu'>
c480ed
+  <name>QEMUGuest1</name>
c480ed
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
c480ed
+  <memory unit='KiB'>219100</memory>
c480ed
+  <currentMemory unit='KiB'>219100</currentMemory>
c480ed
+  <vcpu placement='static'>1</vcpu>
c480ed
+  <os>
c480ed
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
c480ed
+    <boot dev='hd'/>
c480ed
+  </os>
c480ed
+  <clock offset='utc'/>
c480ed
+  <on_poweroff>destroy</on_poweroff>
c480ed
+  <on_reboot>restart</on_reboot>
c480ed
+  <on_crash>destroy</on_crash>
c480ed
+  <devices>
c480ed
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
c480ed
+    <controller type='pci' index='0' model='pci-root'/>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'>
c480ed
+        <zpci uid='0x0023' fid='0x0000003f'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0002' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'>
c480ed
+        <zpci uid='0x0035' fid='0x00000068'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0003' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'>
c480ed
+        <zpci uid='0x0001' fid='0x00000001'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0004' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'>
c480ed
+        <zpci uid='0x0002' fid='0x00000002'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0005' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'>
c480ed
+        <zpci uid='0x0053' fid='0x00000000'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0006' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'>
c480ed
+        <zpci uid='0x0003' fid='0x00000072'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0007' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'>
c480ed
+        <zpci uid='0x0017' fid='0x00000003'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <hostdev mode='subsystem' type='pci' managed='no'>
c480ed
+      <driver name='vfio'/>
c480ed
+      <source>
c480ed
+        <address domain='0x0008' bus='0x00' slot='0x00' function='0x0'/>
c480ed
+      </source>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'>
c480ed
+        <zpci uid='0x0004' fid='0x00000028'/>
c480ed
+      </address>
c480ed
+    </hostdev>
c480ed
+    <memballoon model='virtio'>
c480ed
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'>
c480ed
+        <zpci uid='0x0005' fid='0x00000004'/>
c480ed
+      </address>
c480ed
+    </memballoon>
c480ed
+    <panic model='s390'/>
c480ed
+  </devices>
c480ed
+</domain>
c480ed
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
c480ed
index a787f4f4a3..b2afc8a8ba 100644
c480ed
--- a/tests/qemuxml2xmltest.c
c480ed
+++ b/tests/qemuxml2xmltest.c
c480ed
@@ -488,6 +488,17 @@ mymain(void)
c480ed
     DO_TEST("hostdev-vfio-zpci",
c480ed
             QEMU_CAPS_DEVICE_ZPCI,
c480ed
             QEMU_CAPS_CCW);
c480ed
+    DO_TEST("hostdev-vfio-zpci-multidomain-many",
c480ed
+            QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
c480ed
+            QEMU_CAPS_DEVICE_ZPCI);
c480ed
+    DO_TEST("hostdev-vfio-zpci-autogenerate",
c480ed
+            QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
+            QEMU_CAPS_DEVICE_ZPCI);
c480ed
+    DO_TEST("hostdev-vfio-zpci-boundaries",
c480ed
+            QEMU_CAPS_DEVICE_VFIO_PCI,
c480ed
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
c480ed
+            QEMU_CAPS_DEVICE_ZPCI);
c480ed
     DO_TEST("hostdev-mdev-precreated", NONE);
c480ed
     DO_TEST("hostdev-mdev-display", QEMU_CAPS_VFIO_PCI_DISPLAY);
c480ed
     DO_TEST("pci-rom", NONE);
c480ed
-- 
c480ed
2.22.0
c480ed