diff mbox

[KVM-AUTOTEST] KVM test: fail if qemu complains about KVM module trouble

Message ID 1278623052-12571-1-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish July 8, 2010, 9:04 p.m. UTC
If qemu is tested without KVM intentionally (e.g. with -no-kvm) it won't
complain and the KVM test won't complain either.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_vm.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index e631a3a..6cd0688 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -684,9 +684,17 @@  class VM:
                 self.monitors += [monitor]
 
             # Get the output so far, to see if we have any problems with
-            # hugepage setup.
+            # KVM modules or with hugepage setup.
             output = self.process.get_output()
 
+            if re.search("Could not initialize KVM", output, re.IGNORECASE):
+                logging.error("Could not initialize KVM; "
+                              "qemu command:\n%s" % qemu_command)
+                logging.error("Output:" + kvm_utils.format_str_for_message(
+                              self.process.get_output()))
+                self.destroy()
+                return False
+
             if "alloc_mem_area" in output:
                 logging.error("Could not allocate hugepage memory; "
                               "qemu command:\n%s" % qemu_command)