* [PATCH 1/2] KVM test: Do a better job at handling kvm module failures @ 2009-07-13 19:26 Lucas Meneghel Rodrigues 2009-07-13 19:26 ` [PATCH 2/2] KVM test: Make better documentation of the KVM install test params Lucas Meneghel Rodrigues 2009-07-14 13:34 ` [PATCH 1/2] KVM test: Do a better job at handling kvm module failures Lucas Meneghel Rodrigues 0 siblings, 2 replies; 4+ messages in thread From: Lucas Meneghel Rodrigues @ 2009-07-13 19:26 UTC (permalink / raw) To: autotest; +Cc: kvm, Lucas Meneghel Rodrigues Developers might want to use the KVM test to verify changes only on their own local qemu source directory and will use the 'localsrc' install mode on the KVM test control file, and provide 'load_modules': 'no' option on the params dict inside the kvm control file. However, that option is not documented and defaults to 'yes', and when the code to load kvm modules can't find a built kvm.ko module inside the source dir, an unhandled error exception (totally unhelpful) will be thrown. This patch makes the test throw a much more helpful error message, helping the developer to figure out what is wrong and fix the problem. Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> --- client/tests/kvm/kvm_install.py | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/tests/kvm/kvm_install.py b/client/tests/kvm/kvm_install.py index 10ed7da..7118357 100755 --- a/client/tests/kvm/kvm_install.py +++ b/client/tests/kvm/kvm_install.py @@ -30,15 +30,21 @@ def load_kvm_modules(module_dir): logging.info("Loading new KVM modules...") kvm_module_path = None kvm_vendor_module_path = None + # Search for the built KVM modules for folder, subdirs, files in os.walk(module_dir): if "kvm.ko" in files: kvm_module_path = os.path.join(folder, "kvm.ko") kvm_vendor_module_path = os.path.join(folder, "kvm-%s.ko" % vendor) abort = False - if not os.path.isfile(kvm_module_path): - logging.error("Could not find KVM module that was supposed to be" - " built on the source dir") - abort = True + if not kvm_module_path: + logging.error("Need a directory containing both kernel module and " + "userspace sources.") + logging.error("If you are trying to build only KVM userspace and use " + "the KVM modules you have already loaded, put " + "'load_modules': 'no' on the control file 'params' " + "dictionary.") + raise error.TestError("Could not find a built kvm.ko module on the " + "source dir.") elif not os.path.isfile(kvm_vendor_module_path): logging.error("Could not find KVM (%s) module that was supposed to be" " built on the source dir", vendor) -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] KVM test: Make better documentation of the KVM install test params 2009-07-13 19:26 [PATCH 1/2] KVM test: Do a better job at handling kvm module failures Lucas Meneghel Rodrigues @ 2009-07-13 19:26 ` Lucas Meneghel Rodrigues 2009-07-14 13:35 ` Lucas Meneghel Rodrigues 2009-07-14 13:34 ` [PATCH 1/2] KVM test: Do a better job at handling kvm module failures Lucas Meneghel Rodrigues 1 sibling, 1 reply; 4+ messages in thread From: Lucas Meneghel Rodrigues @ 2009-07-13 19:26 UTC (permalink / raw) To: autotest; +Cc: kvm, Lucas Meneghel Rodrigues In order to improve understanding of the KVM test control, made comments on the kvm_install params dictionary, with all modes supported and examples of usage. Also, commented out parameters that are not going to be used by the default set on that file (KVM install using release tarball). Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> --- client/tests/kvm/control | 53 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 40 insertions(+), 13 deletions(-) diff --git a/client/tests/kvm/control b/client/tests/kvm/control index c030a14..83a1a5f 100644 --- a/client/tests/kvm/control +++ b/client/tests/kvm/control @@ -84,26 +84,53 @@ link_if_not_exist(pwd, images, 'images') link_if_not_exist(pwd, qemu, 'qemu') link_if_not_exist(pwd, qemu_img, 'qemu-img') -# --------------------- -# Build and install kvm -# --------------------- +# -------------------------------------------------------- +# Params that will be passed to the KVM install/build test +# -------------------------------------------------------- params = { "name": "kvm_install", "shortname": "kvm_install", "type": "kvm_install", "mode": "release", - - ## Install from a tarball - "tarball": "/tmp/kvm-84.tar.gz", - - ## Install from a kvm release. - "release_dir": 'http://downloads.sourceforge.net/kvm/', + #"mode": "snapshot", + #"mode": "localtar", + #"mode": "localsrc", + #"mode": "git", + + ## Are we going to load modules built by this test? + ## Defaults to 'yes', so if you are going to provide only userspace code to + ## be built by this test, please set load_modules to 'no', and make sure + ## the kvm and kvm-[vendor] module is already loaded by the time you start + ## it. + #"load_modules": "no", + + ## Install from a kvm release ("mode": "release"). You can optionally + ## specify a release tag. If you omit it, the test will get the latest + ## release tag available. #"release_tag": '84', + "release_dir": 'http://downloads.sourceforge.net/kvm/', - ## Install from git - "git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git', - "user_git_repo": 'git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git', - "kmod_repo": 'git://git.kernel.org/pub/scm/virt/kvm/kvm-kmod.git' + ## Install from a kvm snapshot location ("mode": "snapshot"). You can + ## optionally specify a snapshot date. If you omit it, the test will get + ## yesterday's snapshot. + #"snapshot_date": '20090712' + #"snapshot_dir": 'http://foo.org/kvm-snapshots/', + + ## Install from a tarball ("mode": "localtar") + #"tarball": "/tmp/kvm-84.tar.gz", + + ## Install from a local source code dir ("mode": "localsrc") + #"srcdir": "/path/to/source-dir" + + ## Install from git ("mode": "git") + ## If you provide only "git_repo" and "user_git_repo", the build test + ## will assume it will perform all build from the userspace dir, building + ## modules trough make -C kernel LINUX=%s sync. As of today (07-13-2009) + ## we need 3 git repos, "git_repo" (linux sources), "user_git_repo" and + ## "kmod_repo" to build KVM userspace + kernel modules. + #"git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git', + #"user_git_repo": 'git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git', + #"kmod_repo": 'git://git.kernel.org/pub/scm/virt/kvm/kvm-kmod.git' } # Comment the job.run_test line if you do not want to install kvm on the host. -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] KVM test: Make better documentation of the KVM install test params 2009-07-13 19:26 ` [PATCH 2/2] KVM test: Make better documentation of the KVM install test params Lucas Meneghel Rodrigues @ 2009-07-14 13:35 ` Lucas Meneghel Rodrigues 0 siblings, 0 replies; 4+ messages in thread From: Lucas Meneghel Rodrigues @ 2009-07-14 13:35 UTC (permalink / raw) To: autotest; +Cc: kvm On Mon, 2009-07-13 at 16:26 -0300, Lucas Meneghel Rodrigues wrote: > In order to improve understanding of the KVM test control, made > comments on the kvm_install params dictionary, with all modes > supported and examples of usage. Also, commented out parameters > that are not going to be used by the default set on that file > (KVM install using release tarball). Applied. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] KVM test: Do a better job at handling kvm module failures 2009-07-13 19:26 [PATCH 1/2] KVM test: Do a better job at handling kvm module failures Lucas Meneghel Rodrigues 2009-07-13 19:26 ` [PATCH 2/2] KVM test: Make better documentation of the KVM install test params Lucas Meneghel Rodrigues @ 2009-07-14 13:34 ` Lucas Meneghel Rodrigues 1 sibling, 0 replies; 4+ messages in thread From: Lucas Meneghel Rodrigues @ 2009-07-14 13:34 UTC (permalink / raw) To: autotest; +Cc: kvm On Mon, 2009-07-13 at 16:26 -0300, Lucas Meneghel Rodrigues wrote: > Developers might want to use the KVM test to verify changes > only on their own local qemu source directory and will use the > 'localsrc' install mode on the KVM test control file, and > provide 'load_modules': 'no' option on the params dict inside > the kvm control file. However, that option is not documented and > defaults to 'yes', and when the code to load kvm modules can't > find a built kvm.ko module inside the source dir, an unhandled > error exception (totally unhelpful) will be thrown. > > This patch makes the test throw a much more helpful error message, > helping the developer to figure out what is wrong and fix the > problem. Applied. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-14 13:35 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-07-13 19:26 [PATCH 1/2] KVM test: Do a better job at handling kvm module failures Lucas Meneghel Rodrigues 2009-07-13 19:26 ` [PATCH 2/2] KVM test: Make better documentation of the KVM install test params Lucas Meneghel Rodrigues 2009-07-14 13:35 ` Lucas Meneghel Rodrigues 2009-07-14 13:34 ` [PATCH 1/2] KVM test: Do a better job at handling kvm module failures Lucas Meneghel Rodrigues
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox