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:
Ruidong 2018-09-12 06:50:53 +08:00 committed by Ruidong Cao
parent 516b6ff1d0
commit 5ebb7cf6f5
3 changed files with 11 additions and 9 deletions

4
Gopkg.lock generated
View File

@ -123,11 +123,11 @@
revision = "3520598351bb3500a49ae9563f5539666ae0a27c" revision = "3520598351bb3500a49ae9563f5539666ae0a27c"
[[projects]] [[projects]]
digest = "1:7434a85a1d6c2bf64f322087ec7a7f84ab9e971179bef7b95deabaf0e3f7c126" digest = "1:2b062c3645f86b71bdb0487b4d69746704695fc09158fe4638c213d38c6cc5dc"
name = "github.com/intel/govmm" name = "github.com/intel/govmm"
packages = ["qemu"] packages = ["qemu"]
pruneopts = "NUT" pruneopts = "NUT"
revision = "e2c716433e444017507e3587ce071868fd164380" revision = "032705ba6aae05a9bf41e296cf89c8529cffb822"
[[projects]] [[projects]]
digest = "1:01c37fcb6e2a1fe1321a97faaef74c66ac531ea292ca3f929b7189cc400b1d47" digest = "1:01c37fcb6e2a1fe1321a97faaef74c66ac531ea292ca3f929b7189cc400b1d47"

View File

@ -52,7 +52,7 @@
[[constraint]] [[constraint]]
name = "github.com/intel/govmm" name = "github.com/intel/govmm"
revision = "e2c716433e444017507e3587ce071868fd164380" revision = "032705ba6aae05a9bf41e296cf89c8529cffb822"
[[constraint]] [[constraint]]
name = "github.com/kata-containers/agent" name = "github.com/kata-containers/agent"

View File

@ -812,13 +812,15 @@ func (q *QMP) ExecuteNetdevChardevAdd(ctx context.Context, netdevType, netdevID,
// Must be valid QMP identifier. // Must be valid QMP identifier.
func (q *QMP) ExecuteNetdevAddByFds(ctx context.Context, netdevType, netdevID string, fdNames, vhostFdNames []string) error { func (q *QMP) ExecuteNetdevAddByFds(ctx context.Context, netdevType, netdevID string, fdNames, vhostFdNames []string) error {
fdNameStr := strings.Join(fdNames, ":") fdNameStr := strings.Join(fdNames, ":")
vhostFdNameStr := strings.Join(vhostFdNames, ":")
args := map[string]interface{}{ args := map[string]interface{}{
"type": netdevType, "type": netdevType,
"id": netdevID, "id": netdevID,
"fds": fdNameStr, "fds": fdNameStr,
"vhost": "on", }
"vhostfds": vhostFdNameStr, if len(vhostFdNames) > 0 {
vhostFdNameStr := strings.Join(vhostFdNames, ":")
args["vhost"] = "on"
args["vhostfds"] = vhostFdNameStr
} }
return q.executeCommand(ctx, "netdev_add", args, nil) return q.executeCommand(ctx, "netdev_add", args, nil)