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: 9418037 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 384566022E for ; Tue, 8 Nov 2016 20:02:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 266482887F for ; Tue, 8 Nov 2016 20:02:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B3F128947; Tue, 8 Nov 2016 20:02:23 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14ECE2887F for ; Tue, 8 Nov 2016 20:02:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4CZ7-0003UK-05; Tue, 08 Nov 2016 20:00:17 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4CZ6-0003U7-F9 for xen-devel@lists.xenproject.org; Tue, 08 Nov 2016 20:00:16 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 67/ED-14841-FCE22285; Tue, 08 Nov 2016 20:00:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRWlGSWpSXmKPExsVybKJsh+55PaU Igw/HeSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oz2pR/ZC47zVnw/9pmxgXEDdxcjF4eQwFRG iUMTLzF1MXICOduZJG5d0Aax2QQMJf4+2cQGYosIyEh0XlrECGIzC7QwSux8xN7FyMEhLGAq8 eZOFEiYRUBV4t69TywgNq+Am8Ti+7vBRkoIyEmcPDaZFcTmFPCWuPV1DzNIq5CAl8SUozEQJR kS83rmsELYXhKLblyCstUkrp7bxDyBkW8BI8MqRo3i1KKy1CJdI1O9pKLM9IyS3MTMHF1DA1O 93NTi4sT01JzEpGK95PzcTYzAEKlnYGDcwbir3e8QoyQHk5Ior9wTxQghvqT8lMqMxOKM+KLS nNTiQ4wyHBxKErwVukoRQoJFqempFWmZOcBghUlLcPAoifCeBUnzFhck5hZnpkOkTjEqSonzC oAkBEASGaV5cG2wCLnEKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZg3DWQKT2ZeCdz0V0CLmY AWV8UogCwuSURISTUwRisWnpm2ndvvSeach2df+zHMTJ4i/XhGqsbrDRUmPL96Hq1OvPiTQaj vtNbOyees6+7W342pvunpV3PdTkPavcim/qCE+kmzrm5ZIadaEe1Gr8WfbMzeJLGZ8juv7tbm PjFhh+dTpuzZVRP/Nb2PtV9xufPC272PtYtV1b9lHqi7tEBFPeWsEktxRqKhFnNRcSIALYzyx osCAAA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1478635212!55485653!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14544 invoked from network); 8 Nov 2016 20:00:13 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Nov 2016 20:00:13 -0000 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 Cc: anthony.perard@citrix.com, stefanha@gmail.com, sstabellini@kernel.org, qemu-devel@nongnu.org, xen-devel@lists.xenproject.org Subject: [Xen-devel] [PULL] xen: Fix xenpv machine initialisation X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-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: