From patchwork Thu May 21 00:29:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Burns X-Patchwork-Id: 25150 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4L0VXcG020543 for ; Thu, 21 May 2009 00:31:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756925AbZEUA3W (ORCPT ); Wed, 20 May 2009 20:29:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756906AbZEUA3V (ORCPT ); Wed, 20 May 2009 20:29:21 -0400 Received: from mx1.redhat.com ([66.187.233.31]:50579 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756896AbZEUA3U (ORCPT ); Wed, 20 May 2009 20:29:20 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n4L0TLtM021696 for ; Wed, 20 May 2009 20:29:21 -0400 Received: from mburns.csb (vpn-10-12.bos.redhat.com [10.16.10.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4L0TKmE005516; Wed, 20 May 2009 20:29:20 -0400 Received: by mburns.csb (Postfix, from userid 13432) id 092E0A84D2; Wed, 20 May 2009 20:29:20 -0400 (EDT) From: Mike Burns To: kvm@vger.kernel.org Cc: dhuff@redhat.com, ulublin@redhat.com, Mike Burns Subject: [PATCH][KVM-AUTOTEST][REPOST] Add ability to install custom kernel modules Date: Wed, 20 May 2009 20:29:20 -0400 Message-Id: <1242865760-12086-1-git-send-email-mburns@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org See comment in control file for details of implementation Signed-off-by: Mike Burns --- client/tests/kvm_runtest_2/control | 6 ++++++ client/tests/kvm_runtest_2/kvm_install.py | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control index d6e26bc..437de4c 100644 --- a/client/tests/kvm_runtest_2/control +++ b/client/tests/kvm_runtest_2/control @@ -74,6 +74,12 @@ params = { ## Custom install "install_script": 'custom_kvm_install.sh param1' + + ## Additional kernel modules to install + ## Must be a space separated list of values + ## Installed in the order they are listed. + ## to install mod1.ko, mod2.ko, mod3.ko, you would set like this: + #"additional_modules": 'mod1 mod2 mod3' } # Comment the job.run_test line if you do not want to install kvm on the host. diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py index 392ef0c..80354f5 100755 --- a/client/tests/kvm_runtest_2/kvm_install.py +++ b/client/tests/kvm_runtest_2/kvm_install.py @@ -106,7 +106,7 @@ def run_kvm_install(test, params, env): # load kvm modules (unless requested not to) if params.get('load_modules', "yes") == "yes": - __load_kvm_modules() + __load_kvm_modules(params) else: kvm_log.info("user requested not to load kvm modules") @@ -209,7 +209,7 @@ def __install_kvm_from_local_tarball(test, srcdir, tarball): __install_kvm(test, srcdir) -def __load_kvm_modules(): +def __load_kvm_modules(params): kvm_log.info("Detecting CPU vendor...") vendor = "intel" if os.system("grep vmx /proc/cpuinfo 1>/dev/null") != 0: @@ -237,6 +237,13 @@ def __load_kvm_modules(): os.chdir("x86") utils.system("/sbin/insmod ./kvm.ko && sleep 1 && /sbin/insmod ./kvm-%s.ko" % vendor) + #Add additional modules specified in params by "additional_modules" + #Modules must be named .ko and be located in the + #same location as kvm and kvm-vendor modules + for module in params.get("additional_modules","").split(): + kvm_log.info("Installing module \"%s\"" % module) + utils.system("/sbin/insmod ./%s.ko" % module ) + #elif self.config.load_modules == "no": #kvm_log.info("user requested not to load kvm modules")