From: Eduardo Habkost <ehabkost@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Thomas Huth" <thuth@redhat.com>,
"Amador Pahim" <apahim@redhat.com>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Cleber Rosa" <crosa@redhat.com>,
"Marcel Apfelbaum" <marcel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [RFC 17/18] validator.py script
Date: Wed, 18 Apr 2018 06:22:31 -0300 [thread overview]
Message-ID: <20180418092231.GK29865@localhost.localdomain> (raw)
In-Reply-To: <87lgdl2e87.fsf@dusky.pond.sub.org>
On Wed, Apr 18, 2018 at 08:58:00AM +0200, Markus Armbruster wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
>
> > On Tue, Apr 17, 2018 at 02:01:53PM +0200, Markus Armbruster wrote:
> >> Eduardo Habkost <ehabkost@redhat.com> writes:
> [...]
> >> > + command-line: '$QEMU -nodefaults -machine none'
> >> > + monitor-commands:
> >> > + - qmp:
> >> > + - execute: qom-list-types
> >> > + arguments:
> >> > + implements: 'device'
> >> > + abstract: true
> >> > + - hmp: 'device_add help'
> [...]
> >> > +monitor-commands
> >> > +~~~~~~~~~~~~~~~~
> >> > +
> >> > +Mapping or list-of-mappings containing monitor commands to run.
>
> http://yaml.org/spec/1.2/spec.html talks about mappings and sequences.
> Recommend to say "sequence" rather than "list".
Noted.
>
> I can't see how sequences come into play. Your example's
> monitor-command is a mapping, not a sequence of mappings. Am I
> confused?
The example is supposed to be a sequence of mappings.
>
> >> > The key on each
> >> > +item can be ``hmp`` or ``qmp``. The value on each entry can be a string,
> >> > +mapping, or list.
> >> > +
> >> > +Default: None.
> [...]
> >> Can I do
> >>
> >> monitor-commands:
> >> - qmp:
> >> - execute: eins
> >> - hmp: zwei
> >> - qmp:
> >> - execute: drei
> >>
> >> to execute eins, zwei, drei in this order?
> >
> > Yes, it can. See the test specification examples.
>
> I asked because the YAML spec I quoted above says mappings are unordered
> and must be unique. My example violates "unique", and your "yes, it
> can" violates "unordered".
>
> [...]
The above is a sequence of one-key mappings.
This is a (not very useful) mapping:
>>> yaml.load("""
... qmp:
... - execute: eins
... hmp: zwei
... """)
{'qmp': [{'execute': 'eins'}], 'hmp': 'zwei'}
This is a sequence of one-key mappings:
>>> yaml.load("""
... - qmp:
... - execute: eins
... - hmp: zwei
... - qmp:
... - execute: drei
... """)
[{'qmp': [{'execute': 'eins'}]}, {'hmp': 'zwei'}, {'qmp': [{'execute': 'drei'}]}]
>>>
--
Eduardo
next prev parent reply other threads:[~2018-04-18 9:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 21:38 [Qemu-devel] [RFC 00/18] QEMU validator: A method to specify QEMU crash-test cases Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 01/18] qmp.py: Make it safe to call close() any time Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 02/18] qmp.py: Fix error handling for Python 3 Eduardo Habkost
2018-04-04 8:26 ` Philippe Mathieu-Daudé
2018-03-29 21:38 ` [Qemu-devel] [RFC 03/18] qmp.py: Cleanly handle unexpectedly closed socket Eduardo Habkost
2018-04-04 8:26 ` Philippe Mathieu-Daudé
2018-03-29 21:38 ` [Qemu-devel] [RFC 04/18] qemu.py: Make _vm_monitor a method Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 05/18] qemu.py: Split _base_args() Eduardo Habkost
2018-04-04 8:27 ` Philippe Mathieu-Daudé
2018-03-29 21:38 ` [Qemu-devel] [RFC 06/18] qemu.py: Move _load_io_log() call to _post_shutdown() Eduardo Habkost
2018-04-04 8:27 ` Philippe Mathieu-Daudé
2018-03-29 21:38 ` [Qemu-devel] [RFC 07/18] qemu.py: Use wait() logic inside shutdown() Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 08/18] qemu.py: Close _qmp inside _post_shutdown() Eduardo Habkost
2018-04-04 8:28 ` Philippe Mathieu-Daudé
2018-03-29 21:38 ` [Qemu-devel] [RFC 09/18] qemu.py: Make monitor optional Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 10/18] qemu.py: Set _launched = False on _post_shutdown Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 11/18] qemu.py: Log crashes inside _post_shutdown() Eduardo Habkost
2018-04-04 8:29 ` Philippe Mathieu-Daudé
2018-03-29 21:38 ` [Qemu-devel] [RFC 12/18] qemu.py: Only wait for process if it's still running Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 13/18] qemu.py: 'force' parameter on shutdown() Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 14/18] qemu.py: Don't try to quit cleanly on exceptions Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 15/18] qemu.py: qmp_obj() method Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 16/18] qemu.py: is_launched() method Eduardo Habkost
2018-03-29 21:38 ` [Qemu-devel] [RFC 17/18] validator.py script Eduardo Habkost
2018-04-17 12:01 ` Markus Armbruster
2018-04-17 14:42 ` Eduardo Habkost
2018-04-17 15:17 ` Paolo Bonzini
2018-04-17 15:53 ` Eduardo Habkost
2018-04-18 6:58 ` Markus Armbruster
2018-04-18 9:22 ` Eduardo Habkost [this message]
2018-03-29 21:38 ` [Qemu-devel] [RFC 18/18] Collection of validator.py test cases Eduardo Habkost
2018-03-30 20:28 ` [Qemu-devel] [RFC 00/18] QEMU validator: A method to specify QEMU crash-test cases no-reply
2018-03-31 8:37 ` no-reply
2018-03-31 9:04 ` no-reply
2018-04-01 23:10 ` Philippe Mathieu-Daudé
2018-04-02 9:16 ` Fam Zheng
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=20180418092231.GK29865@localhost.localdomain \
--to=ehabkost@redhat.com \
--cc=apahim@redhat.com \
--cc=armbru@redhat.com \
--cc=crosa@redhat.com \
--cc=f4bug@amsat.org \
--cc=marcel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).