vendor: update govmm

add vhostfd and disable-modern to vhost-vsock-pci

shortlog:
3830b44 qemu: add vhostfd and disable-modern to vhost-vsock-pci
f700a97 qemu/qmp: implement function to hotplug vsock-pci

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes
2018-07-25 07:27:05 -05:00
parent 17a2fb886f
commit 8ae28888e0
4 changed files with 34 additions and 5 deletions

View File

@@ -82,6 +82,9 @@ const (
// VirtioSerialPort is the serial port device driver.
VirtioSerialPort = "virtserialport"
// VHostVSockPCI is the vhost vsock pci driver.
VHostVSockPCI = "vhost-vsock-pci"
)
// ObjectType is a string representing a qemu object type.
@@ -962,6 +965,12 @@ type VSOCKDevice struct {
ID string
ContextID uint32
// VHostFD vhost file descriptor that holds the ContextID
VHostFD *os.File
// DisableModern prevents qemu from relying on fast MMIO.
DisableModern bool
}
const (
@@ -986,12 +995,22 @@ func (vsock VSOCKDevice) Valid() bool {
// QemuParams returns the qemu parameters built out of the VSOCK device.
func (vsock VSOCKDevice) QemuParams(config *Config) []string {
var deviceParams []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, deviceParam)
qemuParams = append(qemuParams, strings.Join(deviceParams, ""))
return qemuParams
}