From patchwork Sun Sep 26 02:28:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 209512 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8Q2NpNe010938 for ; Sun, 26 Sep 2010 02:23:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757303Ab0IZCXt (ORCPT ); Sat, 25 Sep 2010 22:23:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51367 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756062Ab0IZCXs (ORCPT ); Sat, 25 Sep 2010 22:23:48 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8Q2NlNe000998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 25 Sep 2010 22:23:48 -0400 Received: from dhcp-91-158.nay.redhat.com (dhcp-91-158.nay.redhat.com [10.66.91.158]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8Q2Njit000461; Sat, 25 Sep 2010 22:23:46 -0400 Subject: [V2 PATCH 2/2] KVM test: Add vhost-net support To: lmr@redhat.com, autotest@test.kernel.org From: Jason Wang Cc: kvm@vger.kernel.org, mst@redhat.com Date: Sun, 26 Sep 2010 10:28:30 +0800 Message-ID: <20100926022830.5641.17750.stgit@dhcp-91-158.nay.redhat.com> In-Reply-To: <20100926022822.5641.15310.stgit@dhcp-91-158.nay.redhat.com> References: <20100926022822.5641.15310.stgit@dhcp-91-158.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 26 Sep 2010 02:23:51 +0000 (UTC) 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