* [PATCH][KVM-AUTOTEST] Add ability to install custom kernel modules
@ 2009-05-20 22:26 Mike Burns
2009-05-20 22:49 ` Mike Burns
2009-05-20 23:25 ` Michael Goldish
0 siblings, 2 replies; 3+ messages in thread
From: Mike Burns @ 2009-05-20 22:26 UTC (permalink / raw)
To: kvm; +Cc: dhuff, ulublin, Mike Burns
See comments and example in control file for details.
Signed-off-by: Mike Burns <mburns@redhat.com>
---
client/tests/kvm_runtest_2/control | 6 ++++++
client/tests/kvm_runtest_2/kvm_install.py | 7 +++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control
index d6e26bc..02b1d22 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 comma 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..4b703f6 100755
--- a/client/tests/kvm_runtest_2/kvm_install.py
+++ b/client/tests/kvm_runtest_2/kvm_install.py
@@ -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 <value>.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")
--
1.5.5.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH][KVM-AUTOTEST] Add ability to install custom kernel modules
2009-05-20 22:26 [PATCH][KVM-AUTOTEST] Add ability to install custom kernel modules Mike Burns
@ 2009-05-20 22:49 ` Mike Burns
2009-05-20 23:25 ` Michael Goldish
1 sibling, 0 replies; 3+ messages in thread
From: Mike Burns @ 2009-05-20 22:49 UTC (permalink / raw)
To: kvm; +Cc: dhuff, ulublin
Just found out this is really not going to work like I thought it
would. I'll rework and repost later.
Mike Burns wrote:
> See comments and example in control file for details.
>
> Signed-off-by: Mike Burns <mburns@redhat.com>
> ---
> client/tests/kvm_runtest_2/control | 6 ++++++
> client/tests/kvm_runtest_2/kvm_install.py | 7 +++++++
> 2 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control
> index d6e26bc..02b1d22 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 comma 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..4b703f6 100755
> --- a/client/tests/kvm_runtest_2/kvm_install.py
> +++ b/client/tests/kvm_runtest_2/kvm_install.py
> @@ -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 <value>.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")
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH][KVM-AUTOTEST] Add ability to install custom kernel modules
2009-05-20 22:26 [PATCH][KVM-AUTOTEST] Add ability to install custom kernel modules Mike Burns
2009-05-20 22:49 ` Mike Burns
@ 2009-05-20 23:25 ` Michael Goldish
1 sibling, 0 replies; 3+ messages in thread
From: Michael Goldish @ 2009-05-20 23:25 UTC (permalink / raw)
To: Mike Burns; +Cc: dhuff, ulublin, kvm
----- "Mike Burns" <mburns@redhat.com> wrote:
> See comments and example in control file for details.
>
> Signed-off-by: Mike Burns <mburns@redhat.com>
> ---
> client/tests/kvm_runtest_2/control | 6 ++++++
> client/tests/kvm_runtest_2/kvm_install.py | 7 +++++++
> 2 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/client/tests/kvm_runtest_2/control
> b/client/tests/kvm_runtest_2/control
> index d6e26bc..02b1d22 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 comma 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'
> }
Just for consistency, maybe we should make it a space separated list?
Every other list is separated by spaces, like 'vms = vm1 dst'.
> # 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..4b703f6 100755
> --- a/client/tests/kvm_runtest_2/kvm_install.py
> +++ b/client/tests/kvm_runtest_2/kvm_install.py
> @@ -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 <value>.ko and be located in the
> + #same location as kvm and kvm-vendor modules
> + for module in params.get("additional_modules").split(","):
It should probably be a good idea to provide a default value here,
because "additional_modules" isn't necessarily defined, in which
case split() will throw an exception. Something like:
params.get("additional_modules", "")
which returns "" in case "additional_modules" is undefined.
> + 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")
>
> --
> 1.5.5.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-20 23:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20 22:26 [PATCH][KVM-AUTOTEST] Add ability to install custom kernel modules Mike Burns
2009-05-20 22:49 ` Mike Burns
2009-05-20 23:25 ` Michael Goldish
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox