From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxo5M-0001B6-PJ for qemu-devel@nongnu.org; Wed, 15 Feb 2012 18:16:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rxo5I-0000M8-MJ for qemu-devel@nongnu.org; Wed, 15 Feb 2012 18:16:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxo5I-0000Lz-Ax for qemu-devel@nongnu.org; Wed, 15 Feb 2012 18:16:24 -0500 From: Igor Mammedov Date: Thu, 16 Feb 2012 00:16:12 +0100 Message-Id: <1329347774-23262-6-git-send-email-imammedo@redhat.com> In-Reply-To: <1329347774-23262-1-git-send-email-imammedo@redhat.com> References: <1329347774-23262-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 5/7] Set default 'model' property if it wasn't specified yet. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, gleb@redhat.com If cpu model wasn't specified at startup or hot-plug set it to default value for the target. Signed-off-by: Igor Mammedov --- hw/pc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 3d35d78..ec50f16 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -933,6 +933,14 @@ static int cpu_device_init(ICCBusDevice *dev) CPUPC* cpu = DO_UPCAST(CPUPC, busdev, dev); CPUState *env = &cpu->state; + if (cpu->model == NULL) { +#ifdef TARGET_X86_64 + qdev_prop_set_string(&dev->qdev, "model", g_strdup("qemu64")); +#else + qdev_prop_set_string(&dev->qdev, "model", g_strdup("qemu32")); +#endif + } + if (cpu_x86_init_inplace(env, cpu->model) < 0) { return -1; } -- 1.7.7.6