From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harper Subject: Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: refactor kvm_config.py Date: Wed, 9 Feb 2011 17:31:01 -0600 Message-ID: <20110209233101.GG26301@us.ibm.com> References: <1297216207-28375-1-git-send-email-mgoldish@redhat.com> <20110209160603.GO4914@us.ibm.com> <20110209162107.GG3933@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ryan Harper , Michael Goldish , autotest@test.kernel.org, Uri Lublin , kvm@vger.kernel.org To: Eduardo Habkost Return-path: Received: from e32.co.us.ibm.com ([32.97.110.150]:47062 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197Ab1BIXbT (ORCPT ); Wed, 9 Feb 2011 18:31:19 -0500 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e32.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p19NKsjq020772 for ; Wed, 9 Feb 2011 16:20:54 -0700 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p19NVAov102176 for ; Wed, 9 Feb 2011 16:31:10 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p19NV9Fd020209 for ; Wed, 9 Feb 2011 16:31:10 -0700 Content-Disposition: inline In-Reply-To: <20110209162107.GG3933@otherpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: * Eduardo Habkost [2011-02-09 10:22]: > On Wed, Feb 09, 2011 at 10:06:03AM -0600, Ryan Harper wrote: > > > > > > Instead of regular expressions in the filters, the following syntax is used: > > > > > > , means OR > > > .. means AND > > > . means IMMEDIATELY-FOLLOWED-BY > > > > Is there any reason we can't use | for or, and & for AND? I know this > > is just nit picking, but, it certainly reads easier and doesn't need a > > translation. AFAICT, in the implementation, we're just using .split(), > > so, I think the delimiters aren't critical. > > I think the main reason is that " " also means "OR" today (as we use > .split() and I guess we don't want to diverge too much from the previous > format), and having C-like operators that don't allow spaces would lead > to confusion. e.g. I am sure somebody would try to write > "foo & bar | baz" eventually--how would we interpret that? isn't the comma taking the place for " " as OR? Are you keeping both? ".." looks like a mistake to me where one meant to put "." I'd suggest ignoring " " as a OR operator, then as with most operations, you need either parens or order of operation precendence which one can use to interpret foo & bar | baz. > > > > > > > > > Example: > > > > > > only qcow2..Fedora.14, RHEL.6..raw..boot, smp2..qcow2..migrate..ide > > > > > > means select all dicts whose names have: > > > > > > (qcow2 AND (Fedora IMMEDIATELY-FOLLOWED-BY 14)) OR > > > ((RHEL IMMEDIATELY-FOLLOWED-BY 6) AND raw AND boot) OR > > > (smp2 AND qcow2 AND migrate AND ide) > > > > >>> config = "qcow2&Fedora.14|RHEL.6&raw&boot|smp2&qcow2&migrate&ide" > > >>> config > > 'qcow2&Fedora.14|RHEL.6&raw&boot|smp2&qcow2&migrate&ide' > > >>> config.split("|") > > ['qcow2&Fedora.14', 'RHEL.6&raw&boot', 'smp2&qcow2&migrate&ide'] > > What bothers me about the examples above is the absense of spaces, that > makes it not very readable to my eyes. I don't disagree, but the . and .. I don't find very readable either and I need a look-up table to distinguish , from .. and . and " ". The logical operators are well known and recognized. > > -- > Eduardo -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com