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 <jakob.naucke@ibm.com>
This commit is contained in:
Jakob Naucke 2021-04-27 17:53:42 +02:00
parent 3eaeda7f6d
commit abd3c7ea03
No known key found for this signature in database
GPG Key ID: 45FA1C7D310C0EBE

View File

@ -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))
}