From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcOVF-000363-1U for qemu-devel@nongnu.org; Sun, 29 Mar 2015 21:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcOVA-0004bM-UY for qemu-devel@nongnu.org; Sun, 29 Mar 2015 21:28:33 -0400 Received: from mga14.intel.com ([192.55.52.115]:56271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcOVA-0004b0-PN for qemu-devel@nongnu.org; Sun, 29 Mar 2015 21:28:28 -0400 Message-ID: <5518A6B8.2050407@intel.com> Date: Mon, 30 Mar 2015 09:28:24 +0800 From: "Chen, Tiejun" MIME-Version: 1.0 References: <1427073466-16956-1-git-send-email-tiejun.chen@intel.com> <1427073466-16956-3-git-send-email-tiejun.chen@intel.com> <1427208618.21742.421.camel@citrix.com> <55120B1C.5080004@intel.com> <1427279543.10784.53.camel@citrix.com> <551358A7.2090607@intel.com> <1427364418.10784.122.camel@citrix.com> <5514B281.1050301@intel.com> <1427450046.13935.90.camel@citrix.com> In-Reply-To: <1427450046.13935.90.camel@citrix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v3][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 On 2015/3/27 17:54, Ian Campbell wrote: > On Fri, 2015-03-27 at 09:29 +0800, Chen, Tiejun wrote: >> On 2015/3/26 18:06, Ian Campbell wrote: >>> On Thu, 2015-03-26 at 08:53 +0800, Chen, Tiejun wrote: >>>>> Hrm, OK. I suppose we can live with autodetect and igd both meaning igd >>>>> and whoever adds a new type will have to remember to add a check for >>>>> qemu-trad then. >>>>> >>>> >>>> When we really have to introduce a new type, this means we probably need >>>> to change something inside qemu codes. So a new type should just go into >>>> that table to support qemu upstream since now we shouldn't refactor >>>> anything in qemu-xen-traditional, right? >>> >>> We'd want to error out on attempts to use qemu-xen-trad with non-IGD >>> passthru. >>> >> >> On qemu-xen-traditional side, we always recognize this as BOOLEAN, >> >> if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { >> >> flexarray_append(dm_args, "-gfx_passthru"); >> >> } >> >> Additionally, this is also clarified explicitly in manpage, and >> especially we don't change this behavior now, so I'm just wondering why >> we should do this :) > > If someone does gfx_passthru = "foobar" and device_model_version = > "qemu-xen-traditional" in their xl config then it would be rather mean > of us to silently enable IGD passthru for them instead. When this occurs > libxl should notice and fail. > > IGD is currently the only option, so this code would be needed when > someone adds "foobar" support. > Sounds it should be a legacy fix to qemu-xen-tranditional :) So lets do it now, @@ -326,6 +326,10 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, } if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { flexarray_append(dm_args, "-gfx_passthru"); + if (b_info->u.hvm.gfx_passthru_kind > + LIBXL_GFX_PASSTHRU_KIND_IGD) + LOG(ERROR, "unsupported device type for \"gfx_passthru\".\n"); + return NULL; } } else { if (!sdl && !vnc) Thanks Tiejun