From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpgx-0002F5-9i for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:27:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDpgt-0002kc-Ap for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:27:07 -0500 Received: from mga09.intel.com ([134.134.136.24]:31837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpgt-0002kV-4X for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:27:03 -0500 Message-ID: <54BF54C3.1090502@intel.com> Date: Wed, 21 Jan 2015 15:26:59 +0800 From: "Chen, Tiejun" MIME-Version: 1.0 References: <1421824792-3925-1-git-send-email-tiejun.chen@intel.com> In-Reply-To: <1421824792-3925-1-git-send-email-tiejun.chen@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ian.jackson@eu.citrix.com, ian.campbell@citrix.com, wei.liu2@citrix.com Cc: xen-devel@lists.xen.org, qemu-devel@nongnu.org, kraxel@redhat.com CCed Stefano. Thanks Tiejun On 2015/1/21 15:19, 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,gfx_passthru=on". This need > to bring several changes on tool side. > > Signed-off-by: Tiejun Chen > --- > tools/libxl/libxl_dm.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index c2b0487..2b59d2c 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -318,7 +318,10 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, > flexarray_vappend(dm_args, "-net", "none", NULL); > } > if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { > - flexarray_append(dm_args, "-gfx_passthru"); > + if (b_info->device_model_version != > + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > + flexarray_append(dm_args, "-gfx_passthru"); > + } > } > } else { > if (!sdl && !vnc) > @@ -702,7 +705,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, > flexarray_append(dm_args, "none"); > } > if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { > - flexarray_append(dm_args, "-gfx_passthru"); > + if (b_info->device_model_version != > + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > + flexarray_append(dm_args, "-gfx_passthru"); > + } > } > } else { > if (!sdl && !vnc) { > @@ -748,6 +754,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, > machinearg, max_ram_below_4g); > } > } > + > + if (b_info->device_model_version == > + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > + if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { > + machinearg = libxl__sprintf(gc, "%s,gfx_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]); >