0a122b
From 7e144af26a2f0f8b5b972d60c32e55824bcc60b4 Mon Sep 17 00:00:00 2001
0a122b
From: Marcelo Tosatti <mtosatti@redhat.com>
0a122b
Date: Thu, 6 Mar 2014 02:29:12 +0100
0a122b
Subject: [PATCH 03/16] kvm-all: exit in case max vcpus exceeded
0a122b
0a122b
RH-Author: Marcelo Tosatti <mtosatti@redhat.com>
0a122b
Message-id: <20140306022912.GC4955@amt.cnet>
0a122b
Patchwork-id: 58024
0a122b
O-Subject: [RHEL7.0 qemu-kvm PATCH] kvm-all: exit in case max vcpus exceeded
0a122b
Bugzilla: 993429
0a122b
RH-Acked-by: Amos Kong <akong@redhat.com>
0a122b
RH-Acked-by: Andrew Jones <drjones@redhat.com>
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
0a122b
Rather than fall back to TCG (so the user has to discover
0a122b
whats happening, in case of no access to qemu stdout/stderr).
0a122b
(cherry-picked from 9ba3cf540fb9 from uq/master)
0a122b
0a122b
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
0a122b
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
BZ: 993429
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 kvm-all.c |    3 +--
0a122b
 1 files changed, 1 insertions(+), 2 deletions(-)
0a122b
0a122b
diff --git a/kvm-all.c b/kvm-all.c
0a122b
index 16e4f65..adc0a8e 100644
0a122b
--- a/kvm-all.c
0a122b
+++ b/kvm-all.c
0a122b
@@ -1382,11 +1382,10 @@ int kvm_init(void)
0a122b
                     nc->name, nc->num, soft_vcpus_limit);
0a122b
 
0a122b
             if (nc->num > hard_vcpus_limit) {
0a122b
-                ret = -EINVAL;
0a122b
                 fprintf(stderr, "Number of %s cpus requested (%d) exceeds "
0a122b
                         "the maximum cpus supported by KVM (%d)\n",
0a122b
                         nc->name, nc->num, hard_vcpus_limit);
0a122b
-                goto err;
0a122b
+                exit(1);
0a122b
             }
0a122b
         }
0a122b
         nc++;
0a122b
-- 
0a122b
1.7.1
0a122b