mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 03:56:34 +00:00
vendor: update govmm
add vhostfd and disable-modern to vhost-vsock-pci shortlog:3830b44
qemu: add vhostfd and disable-modern to vhost-vsock-pcif700a97
qemu/qmp: implement function to hotplug vsock-pci Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
17a2fb886f
commit
8ae28888e0
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@ -92,7 +92,7 @@
|
|||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/intel/govmm"
|
name = "github.com/intel/govmm"
|
||||||
packages = ["qemu"]
|
packages = ["qemu"]
|
||||||
revision = "ff2401825e0930811919c86c36d64b113aa00083"
|
revision = "6ff20ae2f409df976574d0139b5ec2fa3e314769"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/kata-containers/agent"
|
name = "github.com/kata-containers/agent"
|
||||||
@ -264,6 +264,6 @@
|
|||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "ea3d6532c4375832a1c79d70af45e6722e526bde97f6caf23d90b91267a3cf0b"
|
inputs-digest = "f57c595789df5fbc01e237cc52c7454911dbc37b9282304b6b1f076606e4c157"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/intel/govmm"
|
name = "github.com/intel/govmm"
|
||||||
revision = "ff2401825e0930811919c86c36d64b113aa00083"
|
revision = "6ff20ae2f409df976574d0139b5ec2fa3e314769"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/kata-containers/agent"
|
name = "github.com/kata-containers/agent"
|
||||||
|
23
vendor/github.com/intel/govmm/qemu/qemu.go
generated
vendored
23
vendor/github.com/intel/govmm/qemu/qemu.go
generated
vendored
@ -82,6 +82,9 @@ const (
|
|||||||
|
|
||||||
// VirtioSerialPort is the serial port device driver.
|
// VirtioSerialPort is the serial port device driver.
|
||||||
VirtioSerialPort = "virtserialport"
|
VirtioSerialPort = "virtserialport"
|
||||||
|
|
||||||
|
// VHostVSockPCI is the vhost vsock pci driver.
|
||||||
|
VHostVSockPCI = "vhost-vsock-pci"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ObjectType is a string representing a qemu object type.
|
// ObjectType is a string representing a qemu object type.
|
||||||
@ -962,6 +965,12 @@ type VSOCKDevice struct {
|
|||||||
ID string
|
ID string
|
||||||
|
|
||||||
ContextID uint32
|
ContextID uint32
|
||||||
|
|
||||||
|
// VHostFD vhost file descriptor that holds the ContextID
|
||||||
|
VHostFD *os.File
|
||||||
|
|
||||||
|
// DisableModern prevents qemu from relying on fast MMIO.
|
||||||
|
DisableModern bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -986,12 +995,22 @@ func (vsock VSOCKDevice) Valid() bool {
|
|||||||
|
|
||||||
// QemuParams returns the qemu parameters built out of the VSOCK device.
|
// QemuParams returns the qemu parameters built out of the VSOCK device.
|
||||||
func (vsock VSOCKDevice) QemuParams(config *Config) []string {
|
func (vsock VSOCKDevice) QemuParams(config *Config) []string {
|
||||||
|
var deviceParams []string
|
||||||
var qemuParams []string
|
var qemuParams []string
|
||||||
|
|
||||||
deviceParam := fmt.Sprintf("%s,id=%s,%s=%d", VhostVSOCKPCI, vsock.ID, VSOCKGuestCID, vsock.ContextID)
|
deviceParams = append(deviceParams, fmt.Sprintf("%s", VhostVSOCKPCI))
|
||||||
|
if vsock.DisableModern {
|
||||||
|
deviceParams = append(deviceParams, ",disable-modern=true")
|
||||||
|
}
|
||||||
|
if vsock.VHostFD != nil {
|
||||||
|
qemuFDs := config.appendFDs([]*os.File{vsock.VHostFD})
|
||||||
|
deviceParams = append(deviceParams, fmt.Sprintf(",vhostfd=%d", qemuFDs[0]))
|
||||||
|
}
|
||||||
|
deviceParams = append(deviceParams, fmt.Sprintf(",id=%s", vsock.ID))
|
||||||
|
deviceParams = append(deviceParams, fmt.Sprintf(",%s=%d", VSOCKGuestCID, vsock.ContextID))
|
||||||
|
|
||||||
qemuParams = append(qemuParams, "-device")
|
qemuParams = append(qemuParams, "-device")
|
||||||
qemuParams = append(qemuParams, deviceParam)
|
qemuParams = append(qemuParams, strings.Join(deviceParams, ""))
|
||||||
|
|
||||||
return qemuParams
|
return qemuParams
|
||||||
}
|
}
|
||||||
|
10
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
10
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
@ -881,3 +881,13 @@ func (q *QMP) ExecHotplugMemory(ctx context.Context, qomtype, id, mempath string
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExecutePCIVSockAdd adds a vhost-vsock-pci bus
|
||||||
|
func (q *QMP) ExecutePCIVSockAdd(ctx context.Context, id, guestCID string) error {
|
||||||
|
args := map[string]interface{}{
|
||||||
|
"driver": VHostVSockPCI,
|
||||||
|
"id": id,
|
||||||
|
"guest-cid": guestCID,
|
||||||
|
}
|
||||||
|
return q.executeCommand(ctx, "device_add", args, nil)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user