From patchwork Tue Jun 18 09:59:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 252214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9D28E2C008A for ; Tue, 18 Jun 2013 20:01:34 +1000 (EST) Received: from localhost ([::1]:47332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosjE-0005Jp-IK for incoming@patchwork.ozlabs.org; Tue, 18 Jun 2013 06:01:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoshk-0003HG-U4 for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:00:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uoshg-0002cB-1o for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:00:00 -0400 Received: from smtp.citrix.com ([66.165.176.89]:53732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoshf-0002c0-TO for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:59:55 -0400 X-IronPort-AV: E=Sophos;i="4.87,888,1363132800"; d="scan'208";a="31796775" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA; 18 Jun 2013 09:59:55 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Tue, 18 Jun 2013 05:59:54 -0400 Received: from york.uk.xensource.com ([10.80.228.45] helo=york.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Uoshe-0000Sp-KU; Tue, 18 Jun 2013 10:59:54 +0100 From: Paul Durrant To: , Date: Tue, 18 Jun 2013 10:59:45 +0100 Message-ID: <1371549586-4672-2-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1371549586-4672-1-git-send-email-paul.durrant@citrix.com> References: <1371549586-4672-1-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: Paul Durrant Subject: [Qemu-devel] [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used. Signed-off-by: Paul Durrant --- hw/i386/pc_piix.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index d618570..7bbb59a 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -1,3 +1,4 @@ + /* * QEMU PC System Emulator * @@ -91,6 +92,10 @@ static void pc_init1(MemoryRegion *system_memory, DeviceState *icc_bridge; FWCfgState *fw_cfg = NULL; + if (xen_enabled() && xen_hvm_init() != 0) { + hw_error("xen hardware virtual machine initialisation failed"); + } + icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE); object_property_add_child(qdev_get_machine(), "icc-bridge", OBJECT(icc_bridge), NULL); @@ -320,9 +325,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args) #ifdef CONFIG_XEN static void pc_xen_hvm_init(QEMUMachineInitArgs *args) { - if (xen_hvm_init() != 0) { - hw_error("xen hardware virtual machine initialisation failed"); - } pc_init_pci(args); } #endif