From patchwork Wed Jan 21 07:19:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 431368 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7ABA0140273 for ; Wed, 21 Jan 2015 18:23:42 +1100 (AEDT) Received: from localhost ([::1]:46862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpdb-00010G-CA for incoming@patchwork.ozlabs.org; Wed, 21 Jan 2015 02:23:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpdE-0000V1-VB for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:23:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDpd8-0001ns-8r for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:23:16 -0500 Received: from mga09.intel.com ([134.134.136.24]:9760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpd8-0001nY-3H for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:23:10 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 20 Jan 2015 23:20:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,440,1418112000"; d="scan'208";a="654126971" Received: from tchen0-linux.bj.intel.com ([10.238.154.91]) by fmsmga001.fm.intel.com with ESMTP; 20 Jan 2015 23:23:03 -0800 From: Tiejun Chen To: ian.jackson@eu.citrix.com, ian.campbell@citrix.com, wei.liu2@citrix.com Date: Wed, 21 Jan 2015 15:19:52 +0800 Message-Id: <1421824792-3925-1-git-send-email-tiejun.chen@intel.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 Cc: qemu-devel@nongnu.org, kraxel@redhat.com, xen-devel@lists.xen.org Subject: [Qemu-devel] [RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough 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 When we're working to support IGD GFX passthrough with qemu upstream, instead of "-gfx_passthru" we'd like to make that a machine option, "-machine xxx,gfx_passthru=on". This need to bring several changes on tool side. Signed-off-by: Tiejun Chen --- tools/libxl/libxl_dm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index c2b0487..2b59d2c 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -318,7 +318,10 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, flexarray_vappend(dm_args, "-net", "none", NULL); } if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { - flexarray_append(dm_args, "-gfx_passthru"); + if (b_info->device_model_version != + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { + flexarray_append(dm_args, "-gfx_passthru"); + } } } else { if (!sdl && !vnc) @@ -702,7 +705,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, "none"); } if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { - flexarray_append(dm_args, "-gfx_passthru"); + if (b_info->device_model_version != + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { + flexarray_append(dm_args, "-gfx_passthru"); + } } } else { if (!sdl && !vnc) { @@ -748,6 +754,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, machinearg, max_ram_below_4g); } } + + if (b_info->device_model_version == + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { + if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { + machinearg = libxl__sprintf(gc, "%s,gfx_passthru=on", + machinearg); + } + } + flexarray_append(dm_args, machinearg); for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++) flexarray_append(dm_args, b_info->extra_hvm[i]);