qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Victor Toso <victortoso@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH 01/14] qapi: BlockExportRemoveMode: move comments to TODO
Date: Fri, 25 Mar 2022 21:35:38 +0100	[thread overview]
Message-ID: <20220325203538.eztswc6fj6we26ef@tapioca> (raw)
In-Reply-To: <CAFn=p-aMfoxMn7ZUT1ZK4ifP6J-1PB4nj+74BM2OwAxnWKWX7Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3659 bytes --]

Hi,

Many thanks for the quick review!

On Thu, Mar 24, 2022 at 04:34:42PM -0400, John Snow wrote:
> On Thu, Mar 24, 2022 at 1:50 PM Victor Toso <victortoso@redhat.com> wrote:
> >
> > @hide and @soft are potential additions which fits the TODO section
> > perfectly.
> >
> > The main motivation is to avoid this whole block of comment entering
> > the wrong section in the python parser.
> >
> > Signed-off-by: Victor Toso <victortoso@redhat.com>
> > ---
> >  qapi/block-export.json | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/qapi/block-export.json b/qapi/block-export.json
> > index f183522d0d..1e34927f85 100644
> > --- a/qapi/block-export.json
> > +++ b/qapi/block-export.json
> > @@ -219,13 +219,13 @@
> >  #
> >  # @hard: Drop all connections immediately and remove export.
> >  #
> > -# Potential additional modes to be added in the future:
> > +# TODO: Potential additional modes to be added in the future:
> >  #
> > -# hide: Just hide export from new clients, leave existing connections as is.
> > -# Remove export after all clients are disconnected.
> > +#       hide: Just hide export from new clients, leave existing connections as is.
> > +#       Remove export after all clients are disconnected.
> >  #
> > -# soft: Hide export from new clients, answer with ESHUTDOWN for all further
> > -# requests from existing clients.
> > +#       soft: Hide export from new clients, answer with ESHUTDOWN for all further
> > +#       requests from existing clients.
> >  #
> >  # Since: 2.12
> >  ##
> > --
> > 2.35.1
> >
> 
> Does this help with something in particular? (Got an example for me?)

I'm working on a Golang interface and I'm using the QAPI
documentation to document the Go's types of the QAPI spec. For this
kind of documentation, documentation related to future development
can be excluded. This patch helps me filter it out :)

Example:

  $ cd qemu/scripts && python
  >>> from qapi.schema import QAPISchema
  >>> schema = QAPISchema('../qapi/qapi-schema.json')

  # Without this patch, the 'Potential additional modes' doc is
  # under no specific named Section.
  >>> for s in schema._entity_dict['BlockExportRemoveMode'].doc.sections:
  ...     pprint(vars(s))
  ...
  {'_indent': 0,
   '_parser': <qapi.parser.QAPISchemaParser object at 0x7f4fcf854760>,
   'name': None,
   'text': 'Potential additional modes to be added in the future:\n'
           '\n'
           'hide: Just hide export from new clients, leave existing connections '
           'as is.\n'
           'Remove export after all clients are disconnected.\n'
           '\n'
           'soft: Hide export from new clients, answer with ESHUTDOWN for all '
           'further\n'
           'requests from existing clients.'}
   {'_indent': 7,
   '_parser': <qapi.parser.QAPISchemaParser object at 0x7f4fcf854760>,
   'name': 'Since',
   'text': '2.12'}

  # With this patch, we can filter out TODO section
  >>> pprint(schema._entity_dict['BlockExportRemoveMode'].doc.sections[0]))
  {'_indent': 6,
   '_parser': <qapi.parser.QAPISchemaParser object at 0x7f228d97e950>,
   'name': 'TODO',
   'text': 'Potential additional modes to be added in the future:\n'
           '\n'
           'hide: Just hide export from new clients, leave existing connections '
           'as is.\n'
           'Remove export after all clients are disconnected.\n'
           '\n'
           'soft: Hide export from new clients, answer with ESHUTDOWN for all '
           'further\n'
           'requests from existing clients.'}

Cheers,
Victor

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-03-25 20:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 17:50 [PATCH 00/14] Fix some qapi examples and a TODO section Victor Toso
2022-03-24 17:50 ` [PATCH 01/14] qapi: BlockExportRemoveMode: move comments to TODO Victor Toso
2022-03-24 20:34   ` John Snow
2022-03-25 20:35     ` Victor Toso [this message]
2022-03-25 12:33   ` Markus Armbruster
2022-03-25 15:11     ` John Snow
2022-03-25 20:47       ` Victor Toso
2022-03-28  7:46         ` "Future directions" vs. "TODO" in doc comments (was: [PATCH 01/14] qapi: BlockExportRemoveMode: move comments to TODO) Markus Armbruster
2022-03-29 16:31           ` John Snow
2022-03-24 17:50 ` [PATCH 02/14] qapi: fix example of BLOCK_IMAGE_CORRUPTED event Victor Toso
2022-03-24 19:15   ` John Snow
2022-03-24 20:40     ` John Snow
2022-03-25 12:43       ` Markus Armbruster
2022-03-25 20:59         ` Victor Toso
2022-03-25 21:40           ` John Snow
2022-03-24 17:50 ` [PATCH 03/14] qapi: fix example of BLOCK_IO_ERROR event Victor Toso
2022-03-24 20:47   ` John Snow
2022-03-25 20:52     ` Victor Toso
2022-03-24 17:50 ` [PATCH 04/14] qapi: fix example of BLOCK_JOB_PENDING event Victor Toso
2022-03-24 20:49   ` John Snow
2022-03-25 12:48   ` Markus Armbruster
2022-03-24 17:50 ` [PATCH 05/14] qapi: fix example of DUMP_COMPLETED event Victor Toso
2022-03-24 20:53   ` John Snow
2022-03-25 12:53     ` Markus Armbruster
2022-03-25 21:02       ` Victor Toso
2022-03-24 17:50 ` [PATCH 06/14] qapi: fix example of MEMORY_DEVICE_SIZE_CHANGE event Victor Toso
2022-03-24 20:57   ` John Snow
2022-03-25 13:00     ` Markus Armbruster
2022-03-25 21:03     ` Victor Toso
2022-03-24 17:50 ` [PATCH 07/14] qapi: fix example of UNPLUG_PRIMARY event Victor Toso
2022-03-24 21:01   ` John Snow
2022-03-24 17:50 ` [PATCH 08/14] qapi: fix example of FAILOVER_NEGOTIATED event Victor Toso
2022-03-24 21:05   ` John Snow
2022-03-24 17:50 ` [PATCH 09/14] qapi: run-state examples: add missing member Victor Toso
2022-03-24 21:12   ` John Snow
2022-03-24 17:50 ` [PATCH 10/14] qapi: run-state examples: add missing timestamp Victor Toso
2022-03-24 21:16   ` John Snow
2022-03-24 17:50 ` [PATCH 11/14] qapi: fix example of MEMORY_FAILURE Victor Toso
2022-03-24 21:28   ` John Snow
2022-03-24 17:50 ` [PATCH 12/14] qapi: ui examples: add missing websocket member Victor Toso
2022-03-24 21:22   ` John Snow
2022-03-24 17:50 ` [PATCH 13/14] qapi: fix example of ACPI_DEVICE_OST event Victor Toso
2022-03-24 21:31   ` John Snow
2022-03-24 17:50 ` [PATCH 14/14] qapi: fix example of dump-guest-memory Victor Toso
2022-03-24 21:31   ` John Snow
2022-03-24 21:33 ` [PATCH 00/14] Fix some qapi examples and a TODO section John Snow

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=20220325203538.eztswc6fj6we26ef@tapioca \
    --to=victortoso@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@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).