From: Kashyap Chamarthy <kchamart@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 0/4] scripts: qmp-shell: add transaction support
Date: Thu, 23 Apr 2015 18:23:31 +0200 [thread overview]
Message-ID: <20150423162331.GE10067@tesla.redhat.com> (raw)
In-Reply-To: <1429799701-27089-1-git-send-email-jsnow@redhat.com>
On Thu, Apr 23, 2015 at 10:34:57AM -0400, 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.
>
> ===
> v3:
> ===
>
> - Folding in hotfix from list (import ast)
Seems like a regression from your v2.
It fails here, even for a non-transaction command, with your patch series
applied:
(QEMU) blockdev-snapshot-internal-sync device=drive-ide0-0-0 name=snapshot0
Error while parsing command line: global name '_QMPShell__parse_value' is not defined
command format: <command-name> [arg-name1=arg1] ... [arg-nameN=argN]
Earlier the day, with v2, I was able to test it correctly:
(QEMU) transaction(
TRANS> blockdev-snapshot-sync device=drive-ide0-0-0 snapshot-file=./ext-snap1.qcow2 format=qcow2
TRANS> blockdev-snapshot-internal-sync device=drive-ide0-0-0 name=snapshot0
TRANS> )
{u'return': {}}
(QEMU)
--
/kashyap
>
> ===
> 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 | 126 ++++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 96 insertions(+), 30 deletions(-)
>
> --
> 2.1.0
>
--
/kashyap
next prev parent reply other threads:[~2015-04-23 16:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 14:34 [Qemu-devel] [PATCH v3 0/4] scripts: qmp-shell: add transaction support John Snow
2015-04-23 14:34 ` [Qemu-devel] [PATCH v3 1/4] scripts: qmp-shell: refactor helpers John Snow
2015-04-23 14:34 ` [Qemu-devel] [PATCH v3 2/4] scripts: qmp-shell: Expand support for QMP expressions John Snow
2015-04-23 14:35 ` [Qemu-devel] [PATCH v3 3/4] scripts: qmp-shell: add transaction subshell John Snow
2015-04-23 14:35 ` [Qemu-devel] [PATCH v3 4/4] scripts: qmp-shell: Add verbose flag John Snow
2015-04-23 16:23 ` [Qemu-devel] [PATCH v3 0/4] scripts: qmp-shell: add transaction support John Snow
2015-04-23 16:23 ` Kashyap Chamarthy [this message]
2015-04-28 16:17 ` Kashyap Chamarthy
2015-04-28 16:19 ` John Snow
2015-04-29 15:20 ` Kashyap Chamarthy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150423162331.GE10067@tesla.redhat.com \
--to=kchamart@redhat.com \
--cc=jsnow@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).