From patchwork Tue Feb 3 01:01:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 435674 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 34D98140273 for ; Tue, 3 Feb 2015 12:02:20 +1100 (AEDT) Received: from localhost ([::1]:57302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIRsg-0000P8-Fh for incoming@patchwork.ozlabs.org; Mon, 02 Feb 2015 20:02:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIRsP-00006t-Of for qemu-devel@nongnu.org; Mon, 02 Feb 2015 20:02:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIRsM-0005QB-HP for qemu-devel@nongnu.org; Mon, 02 Feb 2015 20:02:01 -0500 Received: from mga03.intel.com ([134.134.136.65]:42796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIRsM-0005Q2-C8 for qemu-devel@nongnu.org; Mon, 02 Feb 2015 20:01:58 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 02 Feb 2015 16:57:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,509,1418112000"; d="scan'208";a="671784258" Received: from tiejunch-mobl.ccr.corp.intel.com (HELO [10.238.128.159]) ([10.238.128.159]) by fmsmga002.fm.intel.com with ESMTP; 02 Feb 2015 17:01:54 -0800 Message-ID: <54D01E01.6010504@intel.com> Date: Tue, 03 Feb 2015 09:01:53 +0800 From: "Chen, Tiejun" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wei Liu References: <1422839843-25622-1-git-send-email-tiejun.chen@intel.com> <20150202121940.GA28773@zion.uk.xensource.com> In-Reply-To: <20150202121940.GA28773@zion.uk.xensource.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.65 Cc: ian.campbell@citrix.com, Ian.Jackson@eu.citrix.com, qemu-devel@nongnu.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com, kraxel@redhat.com Subject: Re: [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 On 2015/2/2 20:19, Wei Liu wrote: > On Mon, Feb 02, 2015 at 09:17:23AM +0800, Tiejun Chen wrote: >> 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. >> > > My suggestion has one premise -- if upstream QEMU has already released > that -gfx_passthru option. If there is no "old one" (in upstream QEMU) > at all, then there is nothing to keep and deprecate. Understood. > >> 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, > > Note this function is upstream QEMU specfic. Yeah. > >> 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"); >> } > > The comment contradicts what I know (or what I think I know). In our > last email exchange you said there was no "-gfx_passthru" in any version > of upstream QEMU. > > So, shouldn't you just remove this `if' statement? Right. So what about this? libxl: add one machine property to support IGD GFX passthrough When we're working to support IGD GFX passthrough with qemu upstream, we'd like to introduce a machine option, "-machine xxx,igd-passthru=on", to enable/disable that feature. And we also remove that old option, "-gfx_passthru", just from the case of LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN since actually no any qemu stream version really need or use that. Signed-off-by: Tiejun Chen flexarray_append(dm_args, "-nographic"); @@ -748,6 +745,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]); Thanks Tiejun > > Wei. > >> @@ -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]); >> -- >> 1.9.1 > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index c2b0487..b888f19 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -701,9 +701,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, "-net"); flexarray_append(dm_args, "none"); } - if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { - flexarray_append(dm_args, "-gfx_passthru"); - } } else { if (!sdl && !vnc) {