From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vjofu-00025M-Qc for qemu-devel@nongnu.org; Fri, 22 Nov 2013 06:13:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vjofi-00029Z-Ki for qemu-devel@nongnu.org; Fri, 22 Nov 2013 06:13:26 -0500 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:34521 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vjofi-00029U-9M for qemu-devel@nongnu.org; Fri, 22 Nov 2013 06:13:14 -0500 Message-ID: <528F3C57.403@kamp.de> Date: Fri, 22 Nov 2013 12:13:27 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1385044625-31006-1-git-send-email-pl@kamp.de> <528F2EF8.9090509@redhat.com> In-Reply-To: <528F2EF8.9090509@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vl: verify if combination of cpus, sockets, cores and threads is sane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On 22.11.2013 11:16, Paolo Bonzini wrote: > Il 21/11/2013 15:37, Peter Lieven ha scritto: >> - max_cpus = qemu_opt_get_number(opts, "maxcpus", 0); >> + if (cpus != sockets * cores * threads) { >> + fprintf(stderr, "Illegal CPU layout: %d cpus with %d sockets," >> + " %d cores per socket and %d threads per core" >> + " (cpus != sockets * cores * threads)\n", >> + cpus, sockets, cores, threads); >> + exit(1); >> + } > Should max_cpus be checked instead if non-zero? > > I see where you come from, but I think the potential for this patch to > break some working configuration (for some definition of working) is too > high. Can you split out the fixes to the "fill in the blanks" logic? I can, but the number of sockets is logal to the parse function. What would you think is it okay to just send a warning about the illegal config and drop the exit(1). Peter