From patchwork Tue Nov 8 20:00:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9418039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 785836022E for ; Tue, 8 Nov 2016 20:04:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6615B2887F for ; Tue, 8 Nov 2016 20:04:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 585D728947; Tue, 8 Nov 2016 20:04:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEFC22887F for ; Tue, 8 Nov 2016 20:04:44 +0000 (UTC) Received: from localhost ([::1]:35150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4CdQ-0004iE-3O for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 Nov 2016 15:04:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4CZ6-0001fk-CD for qemu-devel@nongnu.org; Tue, 08 Nov 2016 15:00:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4CZ3-0005A5-M5 for qemu-devel@nongnu.org; Tue, 08 Nov 2016 15:00:16 -0500 Received: from mail.kernel.org ([198.145.29.136]:51196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c4CZ3-00059T-Gr for qemu-devel@nongnu.org; Tue, 08 Nov 2016 15:00:13 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3F00202F0; Tue, 8 Nov 2016 20:00:11 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B18B20121; Tue, 8 Nov 2016 20:00:10 +0000 (UTC) From: Stefano Stabellini To: peter.maydell@linaro.org Date: Tue, 8 Nov 2016 12:00:08 -0800 Message-Id: <1478635208-23948-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PULL] xen: Fix xenpv machine initialisation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anthony.perard@citrix.com, stefanha@gmail.com, sstabellini@kernel.org, qemu-devel@nongnu.org, xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Anthony PERARD When using QEMU for Xen PV guest, QEMU abort with: xen-common.c:118:xen_init: Object 0x7f2b8325dcb0 is not an instance of type generic-pc-machine This is because the machine 'xenpv' also use accel=xen. Moving the code to xen_hvm_init() fix the issue. This fix 021746c131cdfeab9d82ff918795a9f18d20d7ae. Signed-off-by: Anthony PERARD Signed-off-by: Stefano Stabellini Reviewed-by: Eduardo Habkost Reviewed-by: Stefano Stabellini --- xen-common.c | 6 ------ xen-hvm.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/xen-common.c b/xen-common.c index bacf962..9099760 100644 --- a/xen-common.c +++ b/xen-common.c @@ -9,7 +9,6 @@ */ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" @@ -115,11 +114,6 @@ static void xen_change_state_handler(void *opaque, int running, static int xen_init(MachineState *ms) { - PCMachineState *pcms = PC_MACHINE(ms); - - /* Disable ACPI build because Xen handles it */ - pcms->acpi_build_enabled = false; - xen_xc = xc_interface_open(0, 0, 0); if (xen_xc == NULL) { xen_pv_printf(NULL, 0, "can't open xen interface\n"); diff --git a/xen-hvm.c b/xen-hvm.c index 2f348ed..150c7e7 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -1316,6 +1316,10 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) } xen_be_register_common(); xen_read_physmap(state); + + /* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; + return; err: