PCI devices don't exist/work. You would see errors such as:
qemu-system-s390x: -device virtio-rng-pci,rng=rng0: MSI-X support is mandatory in the S390
architecture
---
lib/guestfs-internal.h | 38 +++++++++++++++++++++++++++++---------
lib/launch-direct.c | 4 ++--
2 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
index a04ccff09..ebab006b9 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -142,20 +142,40 @@
/* Maximum size of Windows explorer.exe. 2.6MB on Windows 7. */
#define MAX_WINDOWS_EXPLORER_SIZE (4 * 1000 * 1000)
-/* Differences in device names on ARM (virtio-mmio) vs normal
- * hardware with PCI.
+/* Differences in device names on ARMv7 (virtio-mmio), s/390x (CCW) vs
+ * normal hardware with PCI.
*/
-#if !defined(__arm__)
-#define VIRTIO_BLK "virtio-blk-pci"
-#define VIRTIO_SCSI "virtio-scsi-pci"
-#define VIRTIO_SERIAL "virtio-serial-pci"
-#define VIRTIO_NET "virtio-net-pci"
-#else /* ARMv7 */
+#ifdef __arm__
#define VIRTIO_BLK "virtio-blk-device"
#define VIRTIO_SCSI "virtio-scsi-device"
#define VIRTIO_SERIAL "virtio-serial-device"
#define VIRTIO_NET "virtio-net-device"
-#endif /* ARMv7 */
+#define VIRTIO_RNG "virtio-rng-device"
+#endif
+
+#ifdef __s390x__
+#define VIRTIO_BLK "virtio-blk-ccw"
+#define VIRTIO_SCSI "virtio-scsi-ccw"
+#define VIRTIO_SERIAL "virtio-serial-ccw"
+#define VIRTIO_NET "virtio-net-ccw"
+#define VIRTIO_RNG "virtio-rng-ccw"
+#endif
+
+#ifndef VIRTIO_BLK
+#define VIRTIO_BLK "virtio-blk-pci"
+#endif
+#ifndef VIRTIO_SCSI
+#define VIRTIO_SCSI "virtio-scsi-pci"
+#endif
+#ifndef VIRTIO_SERIAL
+#define VIRTIO_SERIAL "virtio-serial-pci"
+#endif
+#ifndef VIRTIO_NET
+#define VIRTIO_NET "virtio-net-pci"
+#endif
+#ifndef VIRTIO_RNG
+#define VIRTIO_RNG "virtio-rng-pci"
+#endif
/* Machine types. */
#ifdef __arm__
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
index 53ffd1d6f..2327f92bb 100644
--- a/lib/launch-direct.c
+++ b/lib/launch-direct.c
@@ -551,14 +551,14 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
* when needing entropy.
*/
if (guestfs_int_qemu_supports_device (g, data->qemu_data,
- "virtio-rng-pci")) {
+ VIRTIO_RNG)) {
start_list ("-object") {
append_list ("rng-random");
append_list ("filename=/dev/urandom");
append_list ("id=rng0");
} end_list ();
start_list ("-device") {
- append_list ("virtio-rng-pci");
+ append_list (VIRTIO_RNG);
append_list ("rng=rng0");
} end_list ();
}
--
2.13.0