From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpdE-0000V1-VB for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:23:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDpd8-0001ns-8r for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:23:16 -0500 Received: from mga09.intel.com ([134.134.136.24]:9760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDpd8-0001nY-3H for qemu-devel@nongnu.org; Wed, 21 Jan 2015 02:23:10 -0500 From: Tiejun Chen Date: Wed, 21 Jan 2015 15:19:52 +0800 Message-Id: <1421824792-3925-1-git-send-email-tiejun.chen@intel.com> Subject: [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: qemu-devel@nongnu.org, kraxel@redhat.com, xen-devel@lists.xen.org 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]); -- 1.9.1