From patchwork Fri Oct 8 15:28:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 241531 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 o98FSV7Z019629 for ; Fri, 8 Oct 2010 15:28:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758414Ab0JHP22 (ORCPT ); Fri, 8 Oct 2010 11:28:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758355Ab0JHP21 (ORCPT ); Fri, 8 Oct 2010 11:28:27 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o98FSQUR007256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Oct 2010 11:28:26 -0400 Received: from freedom.redhat.com (vpn-9-43.rdu.redhat.com [10.11.9.43]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o98FSIQv014267; Fri, 8 Oct 2010 11:28:25 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, jasowang@redhat.com, mst@redhat.com, Lucas Meneghel Rodrigues Subject: [PATCH 2/2] KVM test: Add vhost-net support Date: Fri, 8 Oct 2010 12:28:13 -0300 Message-Id: <1286551693-7872-3-git-send-email-lmr@redhat.com> In-Reply-To: <1286551693-7872-1-git-send-email-lmr@redhat.com> References: <1286551693-7872-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 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]); Fri, 08 Oct 2010 15:28:31 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 3388b14..848ff63 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -282,9 +282,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": @@ -448,7 +450,8 @@ class VM: self.get_ifname(vlan), 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 8d62c42..e849f31 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -702,6 +702,8 @@ variants: # you can add advanced attributes on nic_extra_params # such as mrg_rxbuf #nic_extra_params = + # you can uncomment the following line to enable vhost-net backend + #vhost = yes jumbo: mtu = 65520 ethtool: