Patchwork [2/6] S390: Tell user why VM creation failed

login
register
mail settings
Submitter Alexander Graf
Date April 1, 2010, 4:42 p.m.
Message ID <1270140161-17216-3-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/49222/
State New
Headers show

Comments

Alexander Graf - April 1, 2010, 4:42 p.m.
The KVM kernel module on S390 refuses to create a VM when the switch_amode
kernel parameter is not used.

Since that is not exactly obvious, let's give the user a nice warning.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 kvm-all.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 40b5a51..9de66c9 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -607,8 +607,13 @@  int kvm_init(int smp_cpus)
     }
 
     s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
-    if (s->vmfd < 0)
+    if (s->vmfd < 0) {
+#ifdef TARGET_S390X
+        fprintf(stderr, "Please add the 'switch_amode' kernel parameter to "
+                        "your host kernel command line\n");
+#endif
         goto err;
+    }
 
     /* initially, KVM allocated its own memory and we had to jump through
      * hooks to make phys_ram_base point to this.  Modern versions of KVM