From patchwork Fri Aug 23 09:39:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 269403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6B7362C008C for ; Fri, 23 Aug 2013 19:42:09 +1000 (EST) Received: from localhost ([::1]:36024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCnsd-0006gj-7Y for incoming@patchwork.ozlabs.org; Fri, 23 Aug 2013 05:42:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCnrf-0005pm-LF for qemu-devel@nongnu.org; Fri, 23 Aug 2013 05:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCnrX-0004tQ-23 for qemu-devel@nongnu.org; Fri, 23 Aug 2013 05:41:07 -0400 Received: from mail-ee0-x231.google.com ([2a00:1450:4013:c00::231]:42134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCnrW-0004tE-T1 for qemu-devel@nongnu.org; Fri, 23 Aug 2013 05:40:59 -0400 Received: by mail-ee0-f49.google.com with SMTP id d41so183234eek.36 for ; Fri, 23 Aug 2013 02:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4MCJfMrhK5VGpMIumpIDUrg6gjaWzyN+1E5onqlCKYA=; b=Y/5T79s4Ol7sEH+Kka84uCJhzIOEqasws3H7d/t+HoN0erutFw8RfUtPR0vfBaObe3 3TkhfS7Y4scjHNtkkBZpt28VP5kwGVenYPTfTKbxGXgdqdycvqFfALhakggwf2xhsQAZ jpFC5NO2tZD0Zco7SYQiaJpUk63tzCxHXpr3MX6DykKKgoGArk4+ClAnjk7g542E3pwE J85z8mQ4+DL/BUXWvJb7I+AHFlS2YolfxpFLmBQc8zxjNiL6uzpS3ML9G+LuFDy1fo/p ftKb3Plc50T6fl1vywxgBRy+tshE4w5UsoB1QyMFl3Abmt0Cr4GnTUC+ZiwW3ypS1Aui 69XA== X-Received: by 10.14.99.193 with SMTP id x41mr10346241eef.52.1377250858000; Fri, 23 Aug 2013 02:40:58 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-mxp-t.redhat.com. [209.132.186.18]) by mx.google.com with ESMTPSA id x47sm23523242eea.16.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Aug 2013 02:40:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 23 Aug 2013 11:39:51 +0200 Message-Id: <1377250793-24027-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1377250793-24027-1-git-send-email-pbonzini@redhat.com> References: <1377250793-24027-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::231 Cc: Marcelo Tosatti , anthony@codemonkey.ws, gleb@redhat.com Subject: [Qemu-devel] [PULL 7/9] kvm-all.c: max_cpus should not exceed KVM vcpu limit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcelo Tosatti maxcpus, which specifies the maximum number of hotpluggable CPUs, should not exceed KVM's vcpu limit. Signed-off-by: Marcelo Tosatti [Reword message. - Paolo] Signed-off-by: Paolo Bonzini --- kvm-all.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index ef52a0f..a2d4978 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1400,6 +1400,13 @@ int kvm_init(void) goto err; } + if (max_cpus > max_vcpus) { + ret = -EINVAL; + fprintf(stderr, "Number of hotpluggable cpus requested (%d) exceeds max cpus " + "supported by KVM (%d)\n", max_cpus, max_vcpus); + goto err; + } + s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0); if (s->vmfd < 0) { #ifdef TARGET_S390X