From abd3c7ea036dd329817fabd5e49c1dd87d978c1d Mon Sep 17 00:00:00 2001 From: Jakob Naucke Date: Tue, 27 Apr 2021 17:53:42 +0200 Subject: [PATCH] qemu: VhostUserDevice CCW device numbers Add CCW (s390x) device numbers to VhostUserDevices, as is with other device types. Add them to VhostUserFS devices (the only type currently supported on s390x) when building QEMU parameters. Fixes: #170 Signed-off-by: Jakob Naucke --- qemu/qemu.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qemu/qemu.go b/qemu/qemu.go index adfaa4987b..61ab2cc20b 100644 --- a/qemu/qemu.go +++ b/qemu/qemu.go @@ -1211,6 +1211,9 @@ type VhostUserDevice struct { // ROMFile specifies the ROM file being used for this device. ROMFile string + // DevNo identifies the CCW device for s390x. + DevNo string + // Transport is the virtio transport for this device. Transport VirtioTransport } @@ -1375,6 +1378,9 @@ func (vhostuserDev VhostUserDevice) QemuFSParams(config *Config) []string { if vhostuserDev.SharedVersions { devParams = append(devParams, "versiontable=/dev/shm/fuse_shared_versions") } + if vhostuserDev.Transport.isVirtioCCW(config) { + devParams = append(devParams, fmt.Sprintf("devno=%s", vhostuserDev.DevNo)) + } if vhostuserDev.Transport.isVirtioPCI(config) && vhostuserDev.ROMFile != "" { devParams = append(devParams, fmt.Sprintf("romfile=%s", vhostuserDev.ROMFile)) }