-
Notifications
You must be signed in to change notification settings - Fork 94
Conversation
@@ -1023,13 +1033,13 @@ func (q *QMP) ExecuteNetPCIDeviceAdd(ctx context.Context, netdevID, devID, macAd | |||
// using the device_add command. devID is the id of the device to add. | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general l g t m, @markdryan what do you think about this change ^^ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devimc addr is the PCI address. For CCW devices we don't have it. The devno param is identifying the device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function identifies the devices that needs the devno parm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which would be even smaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, no problem. I'm going to update the code accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the function to map
args := map[string]interface{}{ | ||
"id": devID, | ||
"driver": VirtioNetCCW, | ||
"netdev": netdevID, | ||
"mac": macAddr, | ||
"addr": addr, | ||
"devno": bus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was addr used for previously? Was this only used by s390?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the previous comment. It was not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Add test with devno param Signed-off-by: Alice Frosi <[email protected]>
In order to hotplug virtio-blk, on s390x the CCW device drivers is used instad of PCI. Signed-off-by: Alice Frosi <[email protected]>
The PR adds the devno parameters and the virtio-blk-ccw support.
Fixes: #98