From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn9wD-0002Vp-3f for qemu-devel@nongnu.org; Tue, 17 Jan 2012 09:23:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rn9w8-0003wI-Hw for qemu-devel@nongnu.org; Tue, 17 Jan 2012 09:23:01 -0500 Received: from david.siemens.de ([192.35.17.14]:29162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn9w8-0003w6-75 for qemu-devel@nongnu.org; Tue, 17 Jan 2012 09:22:56 -0500 Message-ID: <4F15843B.7090108@siemens.com> Date: Tue, 17 Jan 2012 15:22:51 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1326806230-2734-1-git-send-email-imammedo@redhat.com> <1326806230-2734-3-git-send-email-imammedo@redhat.com> <4F1582E2.9080007@siemens.com> In-Reply-To: <4F1582E2.9080007@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] VCPU hotplug support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: "pingfank@linux.vnet.ibm.com" , "qemu-devel@nongnu.org" , "gleb@redhat.com" On 2012-01-17 15:17, Jan Kiszka wrote: >> >> /* output Bochs bios info messages */ >> //#define DEBUG_BIOS >> @@ -930,10 +932,22 @@ static void pc_cpu_reset(void *opaque) >> env->halted = !cpu_is_bsp(env); >> } >> >> -static CPUState *pc_new_cpu(const char *cpu_model) >> +CPUState *pc_new_cpu(const char *cpu_model) >> { >> CPUState *env; >> >> + if (cpu_model == NULL) { >> +#ifdef TARGET_X86_64 >> + cpu_model = "qemu64"; >> +#else >> + cpu_model = "qemu32"; >> +#endif > > Just always initialize global_cpu_model to a non-NULL value. Another interface idea: cache the first cpu_model in this function and use the cached one if a later call passes in NULL. That way PIIX4 would not need to have access to an ugly global variable. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux