From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcVsz-0007O6-6Q for qemu-devel@nongnu.org; Mon, 30 Mar 2015 05:21:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcVsu-0003tk-6z for qemu-devel@nongnu.org; Mon, 30 Mar 2015 05:21:33 -0400 Received: from smtp.citrix.com ([66.165.176.89]:40030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcVsu-0003tT-3G for qemu-devel@nongnu.org; Mon, 30 Mar 2015 05:21:28 -0400 Message-ID: <1427707150.13935.235.camel@citrix.com> From: Ian Campbell Date: Mon, 30 Mar 2015 10:19:10 +0100 In-Reply-To: <5518A6B8.2050407@intel.com> 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> <5518A6B8.2050407@intel.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: "Chen, Tiejun" Cc: Ian.Jackson@eu.citrix.com, wei.liu2@citrix.com, qemu-devel@nongnu.org, stefano.stabellini@citrix.com, xen-devel@lists.xen.org On Mon, 2015-03-30 at 09:28 +0800, Chen, Tiejun wrote: > 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; I'd rather not encode any ordering constraints if we don't have to. I think this is preferable: if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { switch (b_info->u.hvm.gfx_passthru_kind) { case LIBXL_GFX_PASSTHRU_KIND_DEFAULT: case LIBXL_GFX_PASSTHRU_KIND_IGD: flexarray_append(dm_args, "-gfx_passthru"); break; default: LOG(ERROR, "unsupported gfx_passthru_kind.\n"); return NULL; } } (notice that the error message above doesn't refer to the xl specific option naming). Ian.