Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwH9b-0005oP-5h for qemu-devel@nongnu.org; Sun, 25 Nov 2007 08:04:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwH9Z-0005mG-Gi for qemu-devel@nongnu.org; Sun, 25 Nov 2007 08:04:06 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwH9Z-0005ls-AE for qemu-devel@nongnu.org; Sun, 25 Nov 2007 08:04:05 -0500 Received: from il.qumranet.com ([82.166.9.18]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwH9Y-0004zP-D4 for qemu-devel@nongnu.org; Sun, 25 Nov 2007 08:04:04 -0500 Date: Sun, 25 Nov 2007 15:04:38 +0200 From: Dan Kenigsberg Subject: Re: [Qemu-devel] [PATCH] Handle cpu_model in copy_cpu() Message-ID: <20071125130437.GA9275@karma.qumranet.com> References: <20071124213028.GA3489@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071124213028.GA3489@localhost.localdomain> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Kirill A. Shutemov" On Sat, Nov 24, 2007 at 11:30:28PM +0200, Kirill A. Shutemov wrote: > copy_cpu() has been broken since cpu_model added to parameters list of > cpu_init(). This patch fix copy_cpu() by storing cpu_model string in > CPUState structure on cpu_init and use this string in copy_cpu(). Please excuse my layman's question: why does each cpu need its own copy of the string, and not just point to the same const char *cpu_model? The reason I'm asking is that > + char cpu_model_str[32]; might be too short for the feature-reach i386 cpu model string, and that > + strcpy(env->cpu_model_str, cpu_model); is not safe when this is mind. Regards, Dan.