Skip to content

Commit

Permalink
Merge pull request autotest#579 from FengYang/vhostfd
Browse files Browse the repository at this point in the history
virttest.qemu_vm: support vhostfd in netdev.
  • Loading branch information
ypu committed Jul 10, 2013
2 parents daf2dac + 1bb156e commit 8598032
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qemu/cfg/host-kernel.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ variants:
query_cmd = "cat /sys/kernel/mm/ksm/pages_sharing"
virtio_net:
vhost = "vhost=on"
# enable_vhostfd only works with vhost=on
enable_vhostfd = yes
Win2008, Win2008r2, Win7:
cpu_model_flags += ",hv_relaxed"
block_stream, drive_mirror, live_snapshot, live_snapshot_chain:
Expand Down Expand Up @@ -135,6 +137,8 @@ variants:
cpu_model_flags += ",hv_relaxed"
virtio_net:
vhost = "vhost=on"
# enable_vhostfd only works with vhost=on
enable_vhostfd = yes
monitor_cmds_check.qmp:
black_cmds = "block-stream block-job-cancel block-job-set-speed drive-mirror block-job-complete block-job-pause block-job-resume"
monitor_cmds_check.human:
Expand Down
4 changes: 4 additions & 0 deletions virttest/qemu_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ def add_net(devices, vlan, nettype, ifname=None, tftp=None,
cmd = " -netdev %s,id=%s" % (mode, netdev_id)
if vhost:
cmd += ",%s" % vhost
enable_vhostfd = params.get("enable_vhostfd", "yes")
if vhost == 'vhost=on' and enable_vhostfd == 'yes':
vhostfd = os.open("/dev/vhost-net", os.O_RDWR)
cmd += ",vhostfd=%s" % vhostfd
if netdev_extra_params:
cmd += "%s" % netdev_extra_params
else:
Expand Down

0 comments on commit 8598032

Please sign in to comment.