Blob Blame Raw
From 7e144af26a2f0f8b5b972d60c32e55824bcc60b4 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Thu, 6 Mar 2014 02:29:12 +0100
Subject: [PATCH 03/16] kvm-all: exit in case max vcpus exceeded

RH-Author: Marcelo Tosatti <mtosatti@redhat.com>
Message-id: <20140306022912.GC4955@amt.cnet>
Patchwork-id: 58024
O-Subject: [RHEL7.0 qemu-kvm PATCH] kvm-all: exit in case max vcpus exceeded
Bugzilla: 993429
RH-Acked-by: Amos Kong <akong@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Rather than fall back to TCG (so the user has to discover
whats happening, in case of no access to qemu stdout/stderr).
(cherry-picked from 9ba3cf540fb9 from uq/master)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
BZ: 993429
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 kvm-all.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 16e4f65..adc0a8e 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1382,11 +1382,10 @@ int kvm_init(void)
                     nc->name, nc->num, soft_vcpus_limit);
 
             if (nc->num > hard_vcpus_limit) {
-                ret = -EINVAL;
                 fprintf(stderr, "Number of %s cpus requested (%d) exceeds "
                         "the maximum cpus supported by KVM (%d)\n",
                         nc->name, nc->num, hard_vcpus_limit);
-                goto err;
+                exit(1);
             }
         }
         nc++;
-- 
1.7.1