From a72ed5b74114ecd508d31548ced7b2f829eb55cc Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Fri, 30 Oct 2020 20:34:23 +0100 Subject: vm/qemu: use virtio-rng-ccw on s390x arch MSI-X support is mandatory for any PCI device on s390x but virtio-rng-pci doesn't support it. Fixes the following error on s390x: qemu-system-s390x: -device virtio-rng-pci: MSI-X support is mandatory in the S390 architecture The problem was introduced in commit 36e8b020 ("vm/qemu: enable virtio-rng-pci"). Signed-off-by: Alexander Egorenkov --- vm/qemu/qemu.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 6c439dbb4..7b2061c20 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -379,10 +379,14 @@ func (inst *instance) boot() error { "-mon", "chardev=SOCKSYZ,mode=control", "-display", "none", "-serial", "stdio", - "-device", "virtio-rng-pci", "-no-reboot", "-name", fmt.Sprintf("VM-%v", inst.index), } + if inst.target.Arch == targets.S390x { + args = append(args, "-device", "virtio-rng-ccw") + } else { + args = append(args, "-device", "virtio-rng-pci") + } templateDir := filepath.Join(inst.workdir, "template") args = append(args, splitArgs(inst.cfg.QemuArgs, templateDir, inst.index)...) args = append(args, -- cgit mrf-deployment