mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
Add support for hot-plugging IBM VFIO-AP devices
Add ExecuteAPVFIOMediatedDeviceAdd to qmp.go, which executes a hotplug for an IBM Adjunct processor (AP) VFIO device (see also https://www.kernel.org/doc/html/latest/s390/vfio-ap.html ) Also includes the respective unittest and adds the VfioAP DeviceDriver constant to qemu.go. Pushing again due to incidental CI failure Fixes: #133 Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com> Reviewed-by: alicefr <afrosi@redhat.com>
This commit is contained in:
@@ -1217,6 +1217,15 @@ func (q *QMP) ExecutePCIVFIOMediatedDeviceAdd(ctx context.Context, devID, sysfsd
|
||||
return q.executeCommand(ctx, "device_add", args, nil)
|
||||
}
|
||||
|
||||
// ExecuteAPVFIOMediatedDeviceAdd adds a VFIO mediated AP device to a QEMU instance using the device_add command.
|
||||
func (q *QMP) ExecuteAPVFIOMediatedDeviceAdd(ctx context.Context, sysfsdev string) error {
|
||||
args := map[string]interface{}{
|
||||
"driver": VfioAP,
|
||||
"sysfsdev": sysfsdev,
|
||||
}
|
||||
return q.executeCommand(ctx, "device_add", args, nil)
|
||||
}
|
||||
|
||||
// isSocketIDSupported returns if the cpu driver supports the socket id option
|
||||
func isSocketIDSupported(driver string) bool {
|
||||
if driver == "host-s390x-cpu" || driver == "host-powerpc64-cpu" {
|
||||
|
||||
Reference in New Issue
Block a user