From patchwork Tue Mar 17 07:46:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 450887 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47EAE14011D for ; Tue, 17 Mar 2015 18:47:34 +1100 (AEDT) Received: from localhost ([::1]:53176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXmDr-0006hM-UD for incoming@patchwork.ozlabs.org; Tue, 17 Mar 2015 03:47:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXmCz-0005PO-F8 for qemu-devel@nongnu.org; Tue, 17 Mar 2015 03:46:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXmCw-00049w-9M for qemu-devel@nongnu.org; Tue, 17 Mar 2015 03:46:37 -0400 Received: from mga03.intel.com ([134.134.136.65]:57962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXmCw-00049F-3V for qemu-devel@nongnu.org; Tue, 17 Mar 2015 03:46:34 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 17 Mar 2015 00:43:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,415,1422950400"; d="scan'208";a="693201753" Received: from tiejunch-mobl.ccr.corp.intel.com (HELO [10.238.130.101]) ([10.238.130.101]) by fmsmga002.fm.intel.com with ESMTP; 17 Mar 2015 00:46:30 -0700 Message-ID: <5507DBD6.8030401@intel.com> Date: Tue, 17 Mar 2015 15:46:30 +0800 From: "Chen, Tiejun" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ian Campbell References: <1425980538-5508-1-git-send-email-tiejun.chen@intel.com> <1425980538-5508-3-git-send-email-tiejun.chen@intel.com> <1426073641.21353.192.camel@citrix.com> <55010596.2030106@intel.com> <1426163186.21353.409.camel@citrix.com> <55023FDA.7030204@intel.com> <1426241479.32572.94.camel@citrix.com> <55062CD2.8050305@intel.com> <1426508400.18247.33.camel@citrix.com> In-Reply-To: <1426508400.18247.33.camel@citrix.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.65 Cc: Ian.Jackson@eu.citrix.com, wei.liu2@citrix.com, qemu-devel@nongnu.org, stefano.stabellini@citrix.com, xen-devel@lists.xen.org Subject: Re: [Qemu-devel] [v2][PATCH 2/2] libxl: introduce gfx_passthru_kind X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org >>> If I remember the context correctly this is in the autodetect case, >>> so I think shouldn't mention IGD. Something like "Unable to detect >>> graphics passthru kind, please set gfx_passthru_kind. See xl.cfg(5) >>> for more >> >> s/gfx_passthru_kind/gfx_passthru, right? Because actually we always get >> 'gfx_passthru_kind' from 'gfx_passthru'. > > I think you have it backwards. > > In the case here gfx_passthru=1 has been set by the user, but > gfx_passthru_kind=DEFAULT. So libxl has tried to autodetect but it has > failed. > > So if the user wants to make progress they should set gfx_passthru_kind > to whatever type of passthrough they were trying to do. Looks you're saying 'gfx_passthru_kind' shouldn't reply on 'gfx_passthru', so 'gfx_passthru_kind' can override that previous value parsed from 'gfx_passthru', right? > > Alternatively I suppose you could recommend removing gfx_passthru=1 (or I'm still keep that currently. > changing to=0), but given they've set =1 that doesn't seem to be the > most productive suggestion. > So looks the whole policy should be something like this, + } + } switch (xlu_cfg_get_list_as_string_list(config, "serial", &b_info->u.hvm.serial_list, 1)) Thanks Tiejun diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 5c40e84..5518759 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1953,8 +1953,27 @@ skip_vfb: xlu_cfg_replace_string (config, "spice_streaming_video", &b_info->u.hvm.spice.streaming_video, 0); xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0); - xlu_cfg_get_defbool(config, "gfx_passthru", - &b_info->u.hvm.gfx_passthru, 0); + if (!xlu_cfg_get_long(config, "gfx_passthru", &l, 1)) { + libxl_defbool_set(&b_info->u.hvm.gfx_passthru, l); + } else if (!xlu_cfg_get_string(config, "gfx_passthru", &buf, 0)) { + if (libxl_gfx_passthru_kind_from_string(buf, + &b_info->u.hvm.gfx_passthru_kind)) { + fprintf(stderr, + "ERROR: invalid value \"%s\" for \"gfx_passthru\"\n", + buf); + exit (1); + } + libxl_defbool_set(&b_info->u.hvm.gfx_passthru, true); + } + if (!xlu_cfg_get_string(config, "gfx_passthru_kind", &buf, 0)) { + if (libxl_gfx_passthru_kind_from_string(buf, + &b_info->u.hvm.gfx_passthru_kind)) { + fprintf(stderr, + "ERROR: invalid value \"%s\" for \"gfx_passthru_kind\"\n", + buf); + exit (1);