From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yl0Iu-0003ru-Gk for qemu-devel@nongnu.org; Wed, 22 Apr 2015 15:27:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yl0Ip-0004Uu-IB for qemu-devel@nongnu.org; Wed, 22 Apr 2015 15:27:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yl0Ip-0004Ue-Dk for qemu-devel@nongnu.org; Wed, 22 Apr 2015 15:27:19 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D1630A10CB for ; Wed, 22 Apr 2015 19:27:18 +0000 (UTC) Message-ID: <5537F615.7010404@redhat.com> Date: Wed, 22 Apr 2015 15:27:17 -0400 From: John Snow MIME-Version: 1.0 References: <1429719709-880-1-git-send-email-jsnow@redhat.com> In-Reply-To: <1429719709-880-1-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/4] scripts: qmp-shell: add transaction support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kchamart@redhat.com, lcapitulino@redhat.com On 04/22/2015 12:21 PM, John Snow wrote: > The qmp-shell is a little rudimentary, but it can be hacked > to give us some transactional support without too much difficulty. > > (1) Prep. > (2) Add support for serializing json arrays > (3) Allow users to use 'single quotes' instead of "double quotes" > (4) Add a special transaction( ... ) syntax that lets users > build up transactional commands using the existing qmp shell > syntax to define each action. > (5) Add a verbose flag to display generated QMP commands. > > The parsing is not as robust as one would like, but this suffices > without adding a proper parser. > > Design considerations: > > (1) Try not to disrupt the existing design of the qmp-shell. The existing > API is not disturbed. > > (2) Pick a "magic token" such that it could not be confused for legitimate > QMP/JSON syntax. Parentheses are used for this purpose. > > === > v2: > === > > - Squash patches 2 & 3: > - Remove wholesale replacement of single quotes, in favor of try blocks > that attempt to parse as pure JSON, then as Python. > - Factored out the value parser block to accomplish the above. > - Allow both true/True and false/False for values. > - Fix typo in patch 3 cover letter. (was patch 4.) > > John Snow (4): > scripts: qmp-shell: refactor helpers > scripts: qmp-shell: Expand support for QMP expressions > scripts: qmp-shell: add transaction subshell > scripts: qmp-shell: Add verbose flag > > scripts/qmp/qmp-shell | 125 ++++++++++++++++++++++++++++++++++++++------------ > 1 file changed, 95 insertions(+), 30 deletions(-) > Version "2+" with the hotfix added, with R-B's added: https://github.com/jnsnow/qemu/commits/qmp-shell-plus To whomever would pull this into their tree: Let me know if you prefer I send a "v3" instead. Thanks, --John