Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
s390x: add appendVSock with devno
Browse files Browse the repository at this point in the history
Reimplementation of appendVSock in order to assign the devno to the
vsock device.

Fixes: #2033

Signed-off-by: Alice Frosi <[email protected]>
  • Loading branch information
Alice Frosi committed Sep 5, 2019
1 parent 6b2a90a commit a0e09df
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions virtcontainers/qemu_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ package virtcontainers

import (
"fmt"
"time"

govmmQemu "github.com/intel/govmm/qemu"
"github.com/kata-containers/runtime/virtcontainers/device/config"
"github.com/kata-containers/runtime/virtcontainers/types"
"time"
)

type qemuS390x struct {
Expand Down Expand Up @@ -257,3 +256,28 @@ func (q *qemuS390x) appendSCSIController(devices []govmmQemu.Device, enableIOThr
devices = append(devices, d)
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

}

0 comments on commit a0e09df

Please sign in to comment.