All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: lmr@redhat.com, autotest@test.kernel.org
Cc: kvm@vger.kernel.org, mst@redhat.com
Subject: [PATCH 2/2] KVM test: Add vhost-net support
Date: Sat, 25 Sep 2010 17:22:15 +0800	[thread overview]
Message-ID: <20100925092215.27856.35742.stgit@dhcp-91-158.nay.redhat.com> (raw)
In-Reply-To: <20100925092207.27856.32816.stgit@dhcp-91-158.nay.redhat.com>

Vhost is a kernel-level backend for virtio. This patch add a nic_params named
"vhost" to enable/disable vhost backend.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 client/tests/kvm/kvm_vm.py             |    7 +++++--
 client/tests/kvm/tests_base.cfg.sample |    2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 644903b..f448684 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -258,9 +258,11 @@ class VM:
 
         def add_net(help, vlan, mode, ifname=None, script=None,
                     downscript=None, tftp=None, bootfile=None, hostfwd=[],
-                    netdev_id=None):
+                    netdev_id=None, vhost=False):
             if has_option(help, "netdev"):
                 cmd = " -netdev %s,id=%s" % (mode, netdev_id)
+                if vhost:
+                    cmd +=",vhost=on"
             else:
                 cmd = " -net %s,vlan=%d" % (mode, vlan)
             if mode == "tap":
@@ -417,7 +419,8 @@ class VM:
                                 nic_params.get("nic_ifname"),
                                 script, downscript, tftp,
                                 nic_params.get("bootp"), redirs,
-                                self.netdev_id[vlan])
+                                self.netdev_id[vlan],
+                                nic_params.get("vhost")=="yes")
             # Proceed to next NIC
             vlan += 1
 
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index 89e6f45..14e85af 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -620,6 +620,8 @@ variants:
         nic_model = virtio
         # you can add advanced attributes here
         # nic_extra_params =
+        # you can uncomment the following line to enable vhost-net backend
+        # vhost = yes
 
 
 # Guests

  reply	other threads:[~2010-09-25  9:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-25  9:22 [PATCH 1/2] KVM test: Use -drive to add nic device when possible Jason Wang
2010-09-25  9:22 ` Jason Wang [this message]
2010-09-25  9:38 ` Markus Armbruster
2010-09-25  9:49   ` Jason Wang
2010-10-08 15:28 [PATCH 0/2] vhost net support v3 Lucas Meneghel Rodrigues
2010-10-08 15:28 ` [PATCH 2/2] KVM test: Add vhost-net support Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100925092215.27856.35742.stgit@dhcp-91-158.nay.redhat.com \
    --to=jasowang@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@redhat.com \
    --cc=mst@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.