[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/6] qapi/parser: Allow empty QAPIDoc Sections
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 2/6] qapi/parser: Allow empty QAPIDoc Sections |
Date: |
Fri, 21 May 2021 07:35:06 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
John Snow <jsnow@redhat.com> writes:
> On 5/20/21 10:42 AM, Markus Armbruster wrote:
>> First step is to find out how _end_section() can be called twice in a
>> row. It isn't in all of "make check". Hmm.
>
> Ah, maybe not twice in a *row*. It does seem to be called when we have
> an "empty section" sometimes, which arises from stuff like this:
>
> Extension error:
> /home/jsnow/src/qemu/docs/../qga/qapi-schema.json:1143:1: ending a
> totally empty section
>
> ##
> # @GuestExec:
> # @pid: pid of child process in guest OS
> #
> # Since: 2.5
> ##
> { 'struct': 'GuestExec',
> 'data': { 'pid': 'int'} }
>
> Without the newline there, it seems to get confused. There's a few
> like this that could be fixed, but then some of the test cases break
> too.
I still can't see it. I tried the obvious
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index f03ba2cfec..263aeb5fc5 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -716,6 +716,7 @@ def _start_section(self, name=None, indent=0):
self.sections.append(self._section)
def _end_section(self):
+ assert self._section
if self._section:
text = self._section.text = self._section.text.strip()
if self._section.name and (not text or text.isspace()):
Does not fire for qga/qapi-schema.json. Can you help?
> No appetite for barking up this tree right now.
>
> Can I fix the commit message and leave the patch in place? Maybe with
> a #FIXME comment nearby?
I'd like to understand your analysis before I answer your question.
[PATCH 4/6] qapi/parser.py: enable mypy checks, John Snow, 2021/05/19
[PATCH 1/6] qapi/parser.py: remove unused check_args_section arguments, John Snow, 2021/05/19
[PATCH 5/6] qapi/parser.py: Silence too-few-public-methods warning, John Snow, 2021/05/19
[PATCH 6/6] qapi/parser.py: enable pylint checks, John Snow, 2021/05/19
[PATCH 3/6] qapi/parser.py: add type hint annotations (QAPIDoc), John Snow, 2021/05/19