From patchwork Mon Feb 2 01:17:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 435314 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 CC5EE1402C0 for ; Mon, 2 Feb 2015 12:21:13 +1100 (AEDT) Received: from localhost ([::1]:52517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI5hP-0001Et-QC for incoming@patchwork.ozlabs.org; Sun, 01 Feb 2015 20:21:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI5hA-0000x5-2O for qemu-devel@nongnu.org; Sun, 01 Feb 2015 20:20:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI5h6-0005Lq-O6 for qemu-devel@nongnu.org; Sun, 01 Feb 2015 20:20:56 -0500 Received: from mga14.intel.com ([192.55.52.115]:4485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI5h6-0005Le-Ib for qemu-devel@nongnu.org; Sun, 01 Feb 2015 20:20:52 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 01 Feb 2015 17:14:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,503,1418112000"; d="scan'208";a="660077636" Received: from tchen0-linux.bj.intel.com ([10.238.154.91]) by fmsmga001.fm.intel.com with ESMTP; 01 Feb 2015 17:20:48 -0800 From: Tiejun Chen To: wei.liu2@citrix.com, Ian.Jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@citrix.com Date: Mon, 2 Feb 2015 09:17:23 +0800 Message-Id: <1422839843-25622-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: 192.55.52.115 Cc: xen-devel@lists.xen.org, kraxel@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [v2][PATCH] 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,-igd-passthru=on". This need to bring a change on tool side. Signed-off-by: Tiejun Chen --- v2: * Based on some discussions with Wei we'd like to keep both old option, -gfx_passthru, and new machine property option, "-machine xxx,-igd-passthru=on" at the same time but deprecate the old one. Then finally we remove the old one at that point that to give downstream (in this case, Xen) time to cope with the change. tools/libxl/libxl_dm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index c2b0487..8405f0b 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -701,6 +701,11 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, "-net"); flexarray_append(dm_args, "none"); } + /* + * Although we already introduce 'igd-passthru', but we'd like + * to remove this until we give downstream time to cope with + * the change. + */ if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { flexarray_append(dm_args, "-gfx_passthru"); } @@ -748,6 +753,11 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, machinearg, max_ram_below_4g); } } + + if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { + machinearg = libxl__sprintf(gc, "%s,igd-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]);