From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTZja-00075c-77 for qemu-devel@nongnu.org; Thu, 05 Mar 2015 12:38:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTZjV-000853-7x for qemu-devel@nongnu.org; Thu, 05 Mar 2015 12:38:54 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:19715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTZjV-00084a-2l for qemu-devel@nongnu.org; Thu, 05 Mar 2015 12:38:49 -0500 Message-ID: <1425576246.25940.286.camel@citrix.com> From: Ian Campbell Date: Thu, 5 Mar 2015 17:24:06 +0000 In-Reply-To: <54F3BACB.4070400@intel.com> References: <1422839843-25622-1-git-send-email-tiejun.chen@intel.com> <20150202121940.GA28773@zion.uk.xensource.com> <21711.29549.892862.333392@mariner.uk.xensource.com> <54D01EAB.1020005@intel.com> <1422961628.9323.32.camel@citrix.com> <54D1770C.4020904@intel.com> <1423046493.17711.28.camel@citrix.com> <54D2C5E5.40407@intel.com> <1423129922.24924.46.camel@citrix.com> <54D41274.9090400@intel.com> <54D8537C.2080805@intel.com> <1423479910.23098.34.camel@citrix.com> <54DAC247.6080004@intel.com> <1424265750.27775.51.camel@citrix.com> <54EEBEBE.10108@intel.com> <1424967433.14641.96.camel@citrix.com> <54F00E9C.5@intel.com> <1425035066.14641.167.camel@citrix.com> <54F3BACB.4070400@intel.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Xen-devel] [v2][PATCH] libxl: add one machine property to support IGD GFX passthrough List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Chen, Tiejun" Cc: Wei Liu , Ian Jackson , qemu-devel@nongnu.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com, kraxel@redhat.com On Mon, 2015-03-02 at 09:20 +0800, Chen, Tiejun wrote: > Is this expected? Yes. Can you post it as a proper patch please. I suggest you split the basic stuff and the kind override discussed below in to two patches. > >> + (b_info->u.hvm.gfx_passthru && > >> + strncmp(b_info->u.hvm.gfx_passthru, "igd", 3) == 0) ) { > > But as you mentioned previously, > > " > You might like to optionally consider add a forcing option somehow so > that people with new devices not in the list can control things without > the need to recompile (e.g. gfx_passthru_kind_override?). > " > > Here I was trying to convert "gfx_passthru" to address this thing. > According to your comment right now, you prefer we should introduce a > new field instead of the original 'gfx_passthru' to enumerate such a > type. So what about this? > > libxl_gfx_passthru_kind_type = Enumeration("gfx_passthru_kind_type", [ "kind_type" is redundant. I think just "kind" will do. > (0, "unknown"), "default" I think is better, i.e. if gfx_passthru is enabled then do the probing from the PCI ID list thing. > (1, "igd"), > ]) You would then need to add a field of this type next to the gfx_passthru one in b_config, lets say it's called gfx_passthru_kind. > Then if we want to override this, just submit the following line into .cfg: > > gfx_passthru_kind_override = "igd" So, while we cannot change the defbool in the libxl interface we do actually have a little more freedom in the xl cfg parsing because we can detect bool/integer vs string. So I think it should be possible to arrange to support any of gfx_passthru = 0 => sets build_info.u.gfx_passthru to false gfx_passthru = 1 => sets build_info.u.gfx_passthru to false and build_info.u.gfx_passthru_kind to DEFAULT gfx_passthru = "igd" => sets build_info.u.gfx_passthru to false and build_info.u.gfx_passthru_kind to IGD Take a look at how the "timer_mode" option is handled in xl_cmdimpl.c (except none of these variants are deprecated. You should be able to use the libxl_..._from_string enum helper to do the parsing in the latter case. Ian.