mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 20:39:41 +00:00
vendor: Update govmm to disable vhost when host doesn't support vhost-net
If the length of vhostfds is zero, it means host doesn't support vhost. So
do not pass vhost="on" in QMP.
Full list:
1a1fee7 qemu/qmp: nic can works without vhost
Fixes #169
Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
This commit is contained in:
14
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
14
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
@@ -812,13 +812,15 @@ func (q *QMP) ExecuteNetdevChardevAdd(ctx context.Context, netdevType, netdevID,
|
||||
// Must be valid QMP identifier.
|
||||
func (q *QMP) ExecuteNetdevAddByFds(ctx context.Context, netdevType, netdevID string, fdNames, vhostFdNames []string) error {
|
||||
fdNameStr := strings.Join(fdNames, ":")
|
||||
vhostFdNameStr := strings.Join(vhostFdNames, ":")
|
||||
args := map[string]interface{}{
|
||||
"type": netdevType,
|
||||
"id": netdevID,
|
||||
"fds": fdNameStr,
|
||||
"vhost": "on",
|
||||
"vhostfds": vhostFdNameStr,
|
||||
"type": netdevType,
|
||||
"id": netdevID,
|
||||
"fds": fdNameStr,
|
||||
}
|
||||
if len(vhostFdNames) > 0 {
|
||||
vhostFdNameStr := strings.Join(vhostFdNames, ":")
|
||||
args["vhost"] = "on"
|
||||
args["vhostfds"] = vhostFdNameStr
|
||||
}
|
||||
|
||||
return q.executeCommand(ctx, "netdev_add", args, nil)
|
||||
|
||||
Reference in New Issue
Block a user