yeahuh / rpms / qemu-kvm

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