From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXmCz-0005PO-F8 for qemu-devel@nongnu.org; Tue, 17 Mar 2015 03:46:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXmCw-00049w-9M for qemu-devel@nongnu.org; Tue, 17 Mar 2015 03:46:37 -0400 Received: from mga03.intel.com ([134.134.136.65]:57962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXmCw-00049F-3V for qemu-devel@nongnu.org; Tue, 17 Mar 2015 03:46:34 -0400 Message-ID: <5507DBD6.8030401@intel.com> Date: Tue, 17 Mar 2015 15:46:30 +0800 From: "Chen, Tiejun" MIME-Version: 1.0 References: <1425980538-5508-1-git-send-email-tiejun.chen@intel.com> <1425980538-5508-3-git-send-email-tiejun.chen@intel.com> <1426073641.21353.192.camel@citrix.com> <55010596.2030106@intel.com> <1426163186.21353.409.camel@citrix.com> <55023FDA.7030204@intel.com> <1426241479.32572.94.camel@citrix.com> <55062CD2.8050305@intel.com> <1426508400.18247.33.camel@citrix.com> In-Reply-To: <1426508400.18247.33.camel@citrix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v2][PATCH 2/2] libxl: introduce gfx_passthru_kind List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Campbell Cc: Ian.Jackson@eu.citrix.com, wei.liu2@citrix.com, qemu-devel@nongnu.org, stefano.stabellini@citrix.com, xen-devel@lists.xen.org >>> If I remember the context correctly this is in the autodetect case, >>> so I think shouldn't mention IGD. Something like "Unable to detect >>> graphics passthru kind, please set gfx_passthru_kind. See xl.cfg(5) >>> for more >> >> s/gfx_passthru_kind/gfx_passthru, right? Because actually we always get >> 'gfx_passthru_kind' from 'gfx_passthru'. > > I think you have it backwards. > > In the case here gfx_passthru=1 has been set by the user, but > gfx_passthru_kind=DEFAULT. So libxl has tried to autodetect but it has > failed. > > So if the user wants to make progress they should set gfx_passthru_kind > to whatever type of passthrough they were trying to do. Looks you're saying 'gfx_passthru_kind' shouldn't reply on 'gfx_passthru', so 'gfx_passthru_kind' can override that previous value parsed from 'gfx_passthru', right? > > Alternatively I suppose you could recommend removing gfx_passthru=1 (or I'm still keep that currently. > changing to=0), but given they've set =1 that doesn't seem to be the > most productive suggestion. > So looks the whole policy should be something like this, diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 5c40e84..5518759 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1953,8 +1953,27 @@ skip_vfb: xlu_cfg_replace_string (config, "spice_streaming_video", &b_info->u.hvm.spice.streaming_video, 0); xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0); - xlu_cfg_get_defbool(config, "gfx_passthru", - &b_info->u.hvm.gfx_passthru, 0); + if (!xlu_cfg_get_long(config, "gfx_passthru", &l, 1)) { + libxl_defbool_set(&b_info->u.hvm.gfx_passthru, l); + } else if (!xlu_cfg_get_string(config, "gfx_passthru", &buf, 0)) { + if (libxl_gfx_passthru_kind_from_string(buf, + &b_info->u.hvm.gfx_passthru_kind)) { + fprintf(stderr, + "ERROR: invalid value \"%s\" for \"gfx_passthru\"\n", + buf); + exit (1); + } + libxl_defbool_set(&b_info->u.hvm.gfx_passthru, true); + } + if (!xlu_cfg_get_string(config, "gfx_passthru_kind", &buf, 0)) { + if (libxl_gfx_passthru_kind_from_string(buf, + &b_info->u.hvm.gfx_passthru_kind)) { + fprintf(stderr, + "ERROR: invalid value \"%s\" for \"gfx_passthru_kind\"\n", + buf); + exit (1); + } + } switch (xlu_cfg_get_list_as_string_list(config, "serial", &b_info->u.hvm.serial_list, 1)) Thanks Tiejun