From patchwork Tue Nov 8 14:07:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9417551 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 4B4EE60585 for ; Tue, 8 Nov 2016 14:08:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D92628A0A for ; Tue, 8 Nov 2016 14:08:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3266C28A16; Tue, 8 Nov 2016 14:08:18 +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 5203128A0A for ; Tue, 8 Nov 2016 14:08:17 +0000 (UTC) Received: from localhost ([::1]:33338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c474S-000784-J9 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 Nov 2016 09:08:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4745-00076r-Nj for qemu-devel@nongnu.org; Tue, 08 Nov 2016 09:07:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4741-00028M-Ma for qemu-devel@nongnu.org; Tue, 08 Nov 2016 09:07:53 -0500 Received: from smtp.citrix.com ([66.165.176.89]:10422) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4741-000288-HJ for qemu-devel@nongnu.org; Tue, 08 Nov 2016 09:07:49 -0500 X-IronPort-AV: E=Sophos;i="5.31,462,1473120000"; d="scan'208";a="388374012" From: Anthony PERARD To: Date: Tue, 8 Nov 2016 14:07:22 +0000 Message-ID: <20161108140722.25194-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 X-DLP: MIA2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Subject: [Qemu-devel] [PATCH v2] 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 , Stefano Stabellini , Wei Liu , Eduardo Habkost , xen-devel@lists.xen.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eduardo Habkost Reviewed-by: Stefano Stabellini --- CC: Wei Liu CC: Eduardo Habkost --- 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: