mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 17:22:33 +00:00
s390x: add appendVSock with devno
Reimplementation of appendVSock in order to assign the devno to the vsock device. Fixes: #2033 Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
This commit is contained in:
parent
6b2a90a9e5
commit
a0e09df1df
@ -7,11 +7,10 @@ package virtcontainers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
govmmQemu "github.com/intel/govmm/qemu"
|
govmmQemu "github.com/intel/govmm/qemu"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/device/config"
|
"github.com/kata-containers/runtime/virtcontainers/device/config"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/types"
|
"github.com/kata-containers/runtime/virtcontainers/types"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type qemuS390x struct {
|
type qemuS390x struct {
|
||||||
@ -257,3 +256,28 @@ func (q *qemuS390x) appendSCSIController(devices []govmmQemu.Device, enableIOThr
|
|||||||
devices = append(devices, d)
|
devices = append(devices, d)
|
||||||
return devices, t
|
return devices, t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (q *qemuS390x) appendVSock(devices []govmmQemu.Device, vsock kataVSOCK) ([]govmmQemu.Device, error) {
|
||||||
|
var devno string
|
||||||
|
id := fmt.Sprintf("vsock-%d", vsock.contextID)
|
||||||
|
addr, b, err := q.addDeviceToBridge(id, types.CCW)
|
||||||
|
if err != nil {
|
||||||
|
return devices, fmt.Errorf("Failed to append VSock: %v", err)
|
||||||
|
}
|
||||||
|
devno, err = b.AddressFormatCCW(addr)
|
||||||
|
if err != nil {
|
||||||
|
return devices, fmt.Errorf("Failed to append VSock: %v", err)
|
||||||
|
}
|
||||||
|
devices = append(devices,
|
||||||
|
govmmQemu.VSOCKDevice{
|
||||||
|
ID: id,
|
||||||
|
ContextID: vsock.contextID,
|
||||||
|
VHostFD: vsock.vhostFd,
|
||||||
|
DisableModern: false,
|
||||||
|
DevNo: devno,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
return devices, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user