Skip to contentSkip to conversation

qmp-shell: add documentation

PATCH Applied John Snow 5 participants 9 messages Jul 1, 2015 – Aug 5, 2015

lore
Share & tools
lore

John Snow

author
#0 lore raw

PATCH 1/1 qmp-shell: add documentation

I should probably document the changes that were made.

---
 scripts/qmp/qmp-shell | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
scripts/qmp/qmp-shell +35 -0
index 65280d2..fa39bf0 100755
@@ -29,6 +29,41 @@
 # (QEMU) device_add driver=e1000 id=net1
 # {u'return': {}}
 # (QEMU)
+#
+# key=value pairs also support Python or JSON object literal subset notations,
+# without spaces. Dictionaries/objects {} are supported as are arrays [].
+#
+#    example-command arg-name1={'key':'value','obj'={'prop':"value"}}
+#
+# Both JSON and Python formatting should work, including both styles of
+# string literal quotes. Both paradigms of literal values should work,
+# including null/true/false for JSON and None/True/False for Python.
+#
+#
+# Transactions have the following multi-line format:
+#
+#    transaction(
+#    action-name1 [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    ...
+#    action-nameN [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    )
+#
+# One line transactions are also supported:
+#
+#    transaction( action-name1 ... )
+#
+# For example:
+#
+#     (QEMU) transaction(
+#     TRANS> block-dirty-bitmap-add node=drive0 name=bitmap1
+#     TRANS> block-dirty-bitmap-clear node=drive0 name=bitmap0
+#     TRANS> )
+#     {"return": {}}
+#     (QEMU)
+#
+# Use the -v and -p options to activate the verbose and pretty-print options,
+# which will echo back the properly formatted JSON-compliant QMP that is being
+# sent to QEMU, which is useful for debugging and documentation generation.
 
 import qmp
 import json
Signature · 1 line
2.1.0
#1 lore raw
Quoted 3 lines · On Wed, 1 Jul 2015 14:25:49 -0400 John Snow <[email protected]> wrote:

I should probably document the changes that were made.

Looks good to me, CC'ing maintainer.

Quoted 50 lines
---
 scripts/qmp/qmp-shell | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
scripts/qmp/qmp-shell +35 -0
index 65280d2..fa39bf0 100755
@@ -29,6 +29,41 @@
 # (QEMU) device_add driver=e1000 id=net1
 # {u'return': {}}
 # (QEMU)
+#
+# key=value pairs also support Python or JSON object literal subset notations,
+# without spaces. Dictionaries/objects {} are supported as are arrays [].
+#
+#    example-command arg-name1={'key':'value','obj'={'prop':"value"}}
+#
+# Both JSON and Python formatting should work, including both styles of
+# string literal quotes. Both paradigms of literal values should work,
+# including null/true/false for JSON and None/True/False for Python.
+#
+#
+# Transactions have the following multi-line format:
+#
+#    transaction(
+#    action-name1 [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    ...
+#    action-nameN [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    )
+#
+# One line transactions are also supported:
+#
+#    transaction( action-name1 ... )
+#
+# For example:
+#
+#     (QEMU) transaction(
+#     TRANS> block-dirty-bitmap-add node=drive0 name=bitmap1
+#     TRANS> block-dirty-bitmap-clear node=drive0 name=bitmap0
+#     TRANS> )
+#     {"return": {}}
+#     (QEMU)
+#
+# Use the -v and -p options to activate the verbose and pretty-print options,
+# which will echo back the properly formatted JSON-compliant QMP that is being
+# sent to QEMU, which is useful for debugging and documentation generation.
 
 import qmp
 import json
author
#2 lore raw
Quoted 9 lines · Luiz Capitulino
Quoted 3 lines · On Wed, 1 Jul 2015 14:25:49 -0400 John Snow <[email protected]> wrote:

I should probably document the changes that were made.

Looks good to me, CC'ing maintainer.

Whoops, didn't realize Markus took this file over, too. Sorry Luiz.

Markus, would you consider staging this? It's purely a documentation update for only a dev tool, so it doesn't really matter /when/ it lands either way, just shoring up some changes I made a while back to the interpreter here.

tldr: "ping"

Quoted 52 lines
Quoted 50 lines
---
 scripts/qmp/qmp-shell | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
scripts/qmp/qmp-shell +35 -0
index 65280d2..fa39bf0 100755
@@ -29,6 +29,41 @@
 # (QEMU) device_add driver=e1000 id=net1
 # {u'return': {}}
 # (QEMU)
+#
+# key=value pairs also support Python or JSON object literal subset notations,
+# without spaces. Dictionaries/objects {} are supported as are arrays [].
+#
+#    example-command arg-name1={'key':'value','obj'={'prop':"value"}}
+#
+# Both JSON and Python formatting should work, including both styles of
+# string literal quotes. Both paradigms of literal values should work,
+# including null/true/false for JSON and None/True/False for Python.
+#
+#
+# Transactions have the following multi-line format:
+#
+#    transaction(
+#    action-name1 [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    ...
+#    action-nameN [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    )
+#
+# One line transactions are also supported:
+#
+#    transaction( action-name1 ... )
+#
+# For example:
+#
+#     (QEMU) transaction(
+#     TRANS> block-dirty-bitmap-add node=drive0 name=bitmap1
+#     TRANS> block-dirty-bitmap-clear node=drive0 name=bitmap0
+#     TRANS> )
+#     {"return": {}}
+#     (QEMU)
+#
+# Use the -v and -p options to activate the verbose and pretty-print options,
+# which will echo back the properly formatted JSON-compliant QMP that is being
+# sent to QEMU, which is useful for debugging and documentation generation.
 
 import qmp
 import json
#3 lore raw
Quoted 5 lines · John Snow
Quoted 4 lines · Luiz Capitulino
Quoted 1 line · On Wed, 1 Jul 2015 14:25:49 -0400 John Snow <[email protected]> wrote:

I should probably document the changes that were made.

John, what do you mean here?

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Looks good to me, CC'ing maintainer.

Luiz, is this a R-by?

Quoted 1 line

Whoops, didn't realize Markus took this file over, too. Sorry Luiz.

Don't worry about our maintainer reshuffling.

Quoted 6 lines

Markus, would you consider staging this? It's purely a documentation update for only a dev tool, so it doesn't really matter /when/ it lands either way, just shoring up some changes I made a while back to the interpreter here.

tldr: "ping"

I'm happy to include this in the next pull after it got reviewed. I'm ignorant about qmp-shell, because I don't use it myself, so I'd have to dig through it to verify your documentation is accurate and reasonably complete.

Fishing for more qualified reviewers:

    $ scripts/get_maintainer.pl --git-blame -f scripts/qmp/qmp-shell 
    Markus Armbruster <[email protected]> (supporter:QMP)
    Luiz Capitulino <[email protected]> (authored lines:230/390=59%,commits:10/10=100%)
    John Snow <[email protected]> (authored lines:117/390=30%,commits:4/10=40%)
    "Daniel P. Berrange" <[email protected]> (authored lines:27/390=7%)
    Eric Blake <[email protected]> (commits:6/10=60%)
    Stefan Hajnoczi <[email protected]> (commits:2/10=20%)
    Benoit Canet <[email protected]> (commits:1/10=10%)

Luiz, can you review for accuracy and reasonable completeness?

Of course, I'm the reviewer of last resort for anything I maintain, whether I understand it or not :)

author
#4 lore raw
Quoted 10 lines · Markus Armbruster
Quoted 5 lines · John Snow
Quoted 4 lines · Luiz Capitulino
Quoted 1 line · On Wed, 1 Jul 2015 14:25:49 -0400 John Snow <[email protected]> wrote:

I should probably document the changes that were made.

John, what do you mean here?

I'm sorry, Markus.

It's a giant circle of people just barely out of the loop. During the 2.4 window I augmented the QMP shell tool to be able to issue transactional commands, and improved the json/python parsing for the key=value pairs.

It was primarily motivated by wanting an easy way to issue and test bitmap commands.

Eric Blake knows the most about the improvements, as he was the original reviewer, but you know how this list likes to strip him out of the CC fields.

Quoted 38 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Looks good to me, CC'ing maintainer.

Luiz, is this a R-by?

Quoted 1 line

Whoops, didn't realize Markus took this file over, too. Sorry Luiz.

Don't worry about our maintainer reshuffling.

Quoted 6 lines

Markus, would you consider staging this? It's purely a documentation update for only a dev tool, so it doesn't really matter /when/ it lands either way, just shoring up some changes I made a while back to the interpreter here.

tldr: "ping"

I'm happy to include this in the next pull after it got reviewed. I'm ignorant about qmp-shell, because I don't use it myself, so I'd have to dig through it to verify your documentation is accurate and reasonably complete.

Fishing for more qualified reviewers:

    $ scripts/get_maintainer.pl --git-blame -f scripts/qmp/qmp-shell 
    Markus Armbruster <[email protected]> (supporter:QMP)
    Luiz Capitulino <[email protected]> (authored lines:230/390=59%,commits:10/10=100%)
    John Snow <[email protected]> (authored lines:117/390=30%,commits:4/10=40%)
    "Daniel P. Berrange" <[email protected]> (authored lines:27/390=7%)
    Eric Blake <[email protected]> (commits:6/10=60%)
    Stefan Hajnoczi <[email protected]> (commits:2/10=20%)
    Benoit Canet <[email protected]> (commits:1/10=10%)

Luiz, can you review for accuracy and reasonable completeness?

Of course, I'm the reviewer of last resort for anything I maintain, whether I understand it or not :)

#5 lore raw
Quoted 6 lines · John Snow

It's a giant circle of people just barely out of the loop. During the 2.4 window I augmented the QMP shell tool to be able to issue transactional commands, and improved the json/python parsing for the key=value pairs.

Quoted 6 lines

It was primarily motivated by wanting an easy way to issue and test bitmap commands.

Eric Blake knows the most about the improvements, as he was the original reviewer, but you know how this list likes to strip him out of the CC fields.

More my fault (and mailman's lousy defaults) than anything else, although I have my own filters set up to try and flag anything with my name, so I usually catch conversations even if I'm omitted from cc.

Did you still need my review on this series at this point, or is it covered now?

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Reviewed-by on v1 1/1
#8 lore raw
In reply to John Snow
Quoted 6 lines · John Snow

I should probably document the changes that were made.

---
 scripts/qmp/qmp-shell | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

Since I did some tests[1] when you wrote these improvements to qmp-shell, the change looks good, FWIW:

[1]
https://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg04201.html

Quoted 50 lines
scripts/qmp/qmp-shell +35 -0
index 65280d2..fa39bf0 100755
@@ -29,6 +29,41 @@
 # (QEMU) device_add driver=e1000 id=net1
 # {u'return': {}}
 # (QEMU)
+#
+# key=value pairs also support Python or JSON object literal subset notations,
+# without spaces. Dictionaries/objects {} are supported as are arrays [].
+#
+#    example-command arg-name1={'key':'value','obj'={'prop':"value"}}
+#
+# Both JSON and Python formatting should work, including both styles of
+# string literal quotes. Both paradigms of literal values should work,
+# including null/true/false for JSON and None/True/False for Python.
+#
+#
+# Transactions have the following multi-line format:
+#
+#    transaction(
+#    action-name1 [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    ...
+#    action-nameN [ arg-name1=arg1 ] ... [arg-nameN=argN ]
+#    )
+#
+# One line transactions are also supported:
+#
+#    transaction( action-name1 ... )
+#
+# For example:
+#
+#     (QEMU) transaction(
+#     TRANS> block-dirty-bitmap-add node=drive0 name=bitmap1
+#     TRANS> block-dirty-bitmap-clear node=drive0 name=bitmap0
+#     TRANS> )
+#     {"return": {}}
+#     (QEMU)
+#
+# Use the -v and -p options to activate the verbose and pretty-print options,
+# which will echo back the properly formatted JSON-compliant QMP that is being
+# sent to QEMU, which is useful for debugging and documentation generation.
 
 import qmp
 import json
Signature · 1 line
2.1.0
Signature · 1 line
/kashyap
Reviewed-by
#6 lore raw
In reply to Markus Armbruster
Quoted 8 lines · On Thu, 23 Jul 2015 09:36:38 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 5 lines · John Snow
Quoted 4 lines · Luiz Capitulino
Quoted 1 line · On Wed, 1 Jul 2015 14:25:49 -0400 John Snow <[email protected]> wrote:

I should probably document the changes that were made.

Quoted 7 lines

John, what do you mean here?

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Looks good to me, CC'ing maintainer.

Luiz, is this a R-by?

This one is :)

Quoted 33 lines
Quoted 2 lines

Whoops, didn't realize Markus took this file over, too. Sorry Luiz.

Don't worry about our maintainer reshuffling.

Quoted 6 lines

Markus, would you consider staging this? It's purely a documentation update for only a dev tool, so it doesn't really matter /when/ it lands either way, just shoring up some changes I made a while back to the interpreter here.

tldr: "ping"

I'm happy to include this in the next pull after it got reviewed. I'm ignorant about qmp-shell, because I don't use it myself, so I'd have to dig through it to verify your documentation is accurate and reasonably complete.

Fishing for more qualified reviewers:

    $ scripts/get_maintainer.pl --git-blame -f scripts/qmp/qmp-shell 
    Markus Armbruster <[email protected]> (supporter:QMP)
    Luiz Capitulino <[email protected]> (authored lines:230/390=59%,commits:10/10=100%)
    John Snow <[email protected]> (authored lines:117/390=30%,commits:4/10=40%)
    "Daniel P. Berrange" <[email protected]> (authored lines:27/390=7%)
    Eric Blake <[email protected]> (commits:6/10=60%)
    Stefan Hajnoczi <[email protected]> (commits:2/10=20%)
    Benoit Canet <[email protected]> (commits:1/10=10%)

Luiz, can you review for accuracy and reasonable completeness?

Of course, I'm the reviewer of last resort for anything I maintain, whether I understand it or not :)

#7 lore raw
Quoted 15 lines · Luiz Capitulino
Quoted 12 lines · On Thu, 23 Jul 2015 09:36:38 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 5 lines · John Snow
Quoted 4 lines · Luiz Capitulino
Quoted 1 line · On Wed, 1 Jul 2015 14:25:49 -0400 John Snow <[email protected]> wrote:

I should probably document the changes that were made.

John, what do you mean here?

Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

Looks good to me, CC'ing maintainer.

Luiz, is this a R-by?

This one is :)

Applied to my qapi-next branch, with "Cc: [email protected]" added to commit message, thanks!