qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 7/7] qapi: Fix array first used in a different module
Date: Fri, 1 Mar 2019 10:25:07 -0600	[thread overview]
Message-ID: <fa36fa5d-0df1-7108-1c26-0c6168e85828@redhat.com> (raw)
In-Reply-To: <20190301154051.23317-8-armbru@redhat.com>

On 3/1/19 9:40 AM, Markus Armbruster wrote:
> We generally put implicitly defined types in whatever module triggered
> their definition.  This is wrong for array types, as the included test
> case demonstrates.  Let's have a closer look at it.
> 
> Type 'Status' is defined sub-sub-module.json.  Array type ['Status']
> occurs in main module qapi-schema-test.json and in
> include/sub-module.json.  The main module's use is first, so the array
> type gets put into the main module.
> 
> The generated C headers define StatusList in qapi-types.h.  But
> include/qapi-types-sub-module.h uses it without including
> qapi-types.h.  Oops.
> 
> To fix that, put the array type into its element type's module.
> 
> Now StatusList gets generated into qapi-types-sub-module.h, which all
> its users include.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---

Yay! One less hack in .qapi files where we had to use dummy structs to
work around awkward declaration locations.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

      reply	other threads:[~2019-03-01 16:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 15:40 [Qemu-devel] [PATCH 0/7] qapi: Code generation fixes Markus Armbruster
2019-03-01 15:40 ` [Qemu-devel] [PATCH 1/7] tests/qapi-schema: Make test-qapi.py print arrays Markus Armbruster
2019-03-01 15:45   ` Eric Blake
2019-03-04  8:17     ` Markus Armbruster
2019-03-01 15:40 ` [Qemu-devel] [PATCH 2/7] tests/qapi-schema: Cover conditional arrays Markus Armbruster
2019-03-01 15:46   ` Eric Blake
2019-03-01 15:40 ` [Qemu-devel] [PATCH 3/7] qapi: Pass file name to QAPIGen constructor instead of methods Markus Armbruster
2019-03-01 15:49   ` Eric Blake
2019-03-01 15:40 ` [Qemu-devel] [PATCH 4/7] qapi: Fix code generation for sub-modules in other directories Markus Armbruster
2019-03-01 16:00   ` Eric Blake
2019-03-04  8:26     ` Markus Armbruster
2019-03-01 15:40 ` [Qemu-devel] [PATCH 5/7] tests: Rename UserDefNativeListUnion to UserDefListUnion Markus Armbruster
2019-03-01 16:21   ` Eric Blake
2019-03-01 15:40 ` [Qemu-devel] [PATCH 6/7] tests/qapi-schema: Cover forward reference to sub-module Markus Armbruster
2019-03-01 16:22   ` Eric Blake
2019-03-01 15:40 ` [Qemu-devel] [PATCH 7/7] qapi: Fix array first used in a different module Markus Armbruster
2019-03-01 16:25   ` Eric Blake [this message]

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=fa36fa5d-0df1-7108-1c26-0c6168e85828@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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).