From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgAkJ-00060d-MA for qemu-devel@nongnu.org; Tue, 12 Nov 2013 04:59:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgAkE-00060j-2d for qemu-devel@nongnu.org; Tue, 12 Nov 2013 04:58:55 -0500 Date: Tue, 12 Nov 2013 10:58:37 +0100 From: Igor Mammedov Message-ID: <20131112105837.63c831e6@thinkpad> In-Reply-To: <52816D26.3070708@ozlabs.ru> References: <1384155875-26999-1-git-send-email-aik@ozlabs.ru> <1384155875-26999-5-git-send-email-aik@ozlabs.ru> <5280D061.50802@suse.de> <20131111152546.4be13e10@thinkpad> <52816D26.3070708@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 4/6] qemu-option: support +foo/-foo command line agruments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alexander Graf , Jan Kiszka , qemu-devel@nongnu.org, Luiz Capitulino , qemu-ppc@nongnu.org, Anthony Liguori , Andreas =?ISO-8859-1?B?RuRyYmVy?= On Tue, 12 Nov 2013 10:49:58 +1100 Alexey Kardashevskiy wrote: > On 11/12/2013 01:25 AM, Igor Mammedov wrote: > > On Mon, 11 Nov 2013 13:41:05 +0100 > > Andreas F=E4rber wrote: > >=20 > >> Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy: > >>> This converts +foo/-foo to "foo=3Don"/"foo=3Doff" respectively when > >>> QEMU parser is used for the command line options. > >>> > >>> "-cpu" parsers in x86 and other architectures should be unaffected > >>> by this change. > >>> > >>> Signed-off-by: Alexey Kardashevskiy > >>> --- > >>> util/qemu-option.c | 6 ++++++ > >>> 1 file changed, 6 insertions(+) > >>> > >>> diff --git a/util/qemu-option.c b/util/qemu-option.c > >>> index efcb5dc..6c8667c 100644 > >>> --- a/util/qemu-option.c > >>> +++ b/util/qemu-option.c > >>> @@ -890,6 +890,12 @@ static int opts_do_parse(QemuOpts *opts, const c= har *params, > >>> if (strncmp(option, "no", 2) =3D=3D 0) { > >>> memmove(option, option+2, strlen(option+2)+1); > >>> pstrcpy(value, sizeof(value), "off"); > >>> + } else if (strncmp(option, "-", 1) =3D=3D 0) { > >>> + memmove(option, option+1, strlen(option+1)+1); > >>> + pstrcpy(value, sizeof(value), "off"); > >>> + } else if (strncmp(option, "+", 1) =3D=3D 0) { > >>> + memmove(option, option+1, strlen(option+1)+1); > >>> + pstrcpy(value, sizeof(value), "on"); > >>> } else { > >>> pstrcpy(value, sizeof(value), "on"); > >>> } > >> > >> This looks like an interesting idea! However this is much too big a > >> change to just CC ppc folks on... > >> > >> Jan, I wonder if this might break slirp's hostfwd option? > >> > >> Not sure what other options potentially starting with '-' might be > >> affected. Test cases would be a helpful way of demonstrating that this > >> change does not have undesired side effects. > > on x86 there is several value fixups for compatibility reason and a man= ual > > value parsing in cpu_x86_parse_featurestr(), so above won't just work t= here. >=20 >=20 > What particular x86 CPU option cannot be handled the way as PPC's "VSX" is > handled two patches below? As I see, even static properties will work the= re > fine. There is legacy code that is kept for CLI compatibility reasons. Please, look at following features in cpu_x86_parse_featurestr(): xlevel, tsc-freq hv-spinlocks the rest feature flags on x86 should be handled just fine by your patch, once x86properties series is applied.=20 that's why we are talking about parser hook that could be overridden by target if necessary. PS: extending QemuOpts to parsing +/-opts format, seems like good workaround above problem. But I was under impression that general movement was to conv= ert custom formats to canonical format "prop=3Dvalue". >=20 >=20 > --=20 > Alexey >=20 --=20 Regards, Igor