Support for virtio-blk-ccw#99
Conversation
| // Must be valid QMP identifier. netdevID is the id of nic added by previous netdev_add. | ||
| // queues is the number of queues of a nic. | ||
| func (q *QMP) ExecuteNetCCWDeviceAdd(ctx context.Context, netdevID, devID, macAddr, addr, bus string, queues int) error { | ||
| func (q *QMP) ExecuteNetCCWDeviceAdd(ctx context.Context, netdevID, devID, macAddr, bus string, queues int) error { |
There was a problem hiding this comment.
In general l g t m, @markdryan what do you think about this change ^^ ?
There was a problem hiding this comment.
@devimc addr is the PCI address. For CCW devices we don't have it. The devno param is identifying the device
qemu/qemus390x.go
Outdated
| } | ||
|
|
||
| // isVirtioCCW returns if the device is a ccw device | ||
| func isVirtioCCW(device DeviceDriver) bool { |
There was a problem hiding this comment.
What's the purpose of this function? There's nothing wrong with it but it is inconistent with the way the checks are handled for the pci driver, where we check the map directly, e.g.,
if isVirtioPCI[fsdev.Driver] {
deviceParams = append(deviceParams, fmt.Sprintf(",romfile=%s", fsdev.ROMFile)) deviceParams = append(deviceParams, fmt.Sprintf(",romfile=%s", fsdev.ROMFile))
} }
if isVirtioCCW(fsdev.Driver) {
whichlooks a little weird.
There was a problem hiding this comment.
The purpose of the function is to return false on not-s390x arch. It was a little bit smaller than having a mapping as for isVirtioPCI, but if you prefer for consistency, I can create a mapping in qemu_arch_base.go with false for all the devices.
There was a problem hiding this comment.
The function identifies the devices that needs the devno parm
There was a problem hiding this comment.
My Go's a little rusty these days but couldn't you achieve the same by doing
var isVirtioCCW = map[DeviceDriver]bool{}
in qemu_arch_base.go?
There was a problem hiding this comment.
which would be even smaller
There was a problem hiding this comment.
ok, no problem. I'm going to update the code accordingly
| "netdev": netdevID, | ||
| "mac": macAddr, | ||
| "addr": addr, | ||
| "devno": bus, |
There was a problem hiding this comment.
What was addr used for previously? Was this only used by s390?
There was a problem hiding this comment.
See the previous comment. It was not used
There was a problem hiding this comment.
I see and this is a s390 specific function so I guess we should be okay.
DevNo is used to identify the ccw device for s390x systems Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Add test with devno param Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
In order to hotplug virtio-blk, on s390x the CCW device drivers is used instad of PCI. Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
The PR adds the devno parameters and the virtio-blk-ccw support.
Fixes: #98