All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Kővágó, Zoltán" <dirty.ice.hu@gmail.com>, qemu-devel@nongnu.org
Cc: Yang Hongyang <yanghy@cn.fujitsu.com>,
	Markus Armbruster <armbru@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/7] qapi: support implicit structs in OptsVisitor
Date: Fri, 18 Sep 2015 06:26:52 -0600	[thread overview]
Message-ID: <55FC030C.7040505@redhat.com> (raw)
In-Reply-To: <55FB22EA.6030506@redhat.com>

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

On 09/17/2015 02:30 PM, Eric Blake wrote:
> On 09/07/2015 06:08 AM, Kővágó, Zoltán wrote:
>> They are required for flat unions (you still have to allocate the
>> structs).
>>
>> Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
>> ---
>>  qapi/opts-visitor.c | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> and required for 'make check' to pass when 4/7 is applied, so:
> 
> Tested-by: Eric Blake <eblake@redhat.com>
> 
>>
>> diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
>> index 7ae33b3..aa68814 100644
>> --- a/qapi/opts-visitor.c
>> +++ b/qapi/opts-visitor.c
>> @@ -149,6 +149,12 @@ opts_start_struct(Visitor *v, void **obj, const char *kind,
>>      }
>>  }
>>  
>> +static void
>> +opts_start_implicit_struct(Visitor *v, void **obj, size_t size, Error **errp)
>> +{
>> +    opts_start_struct(v, obj, NULL, NULL, size, errp);
> 
> Works because ov->depth is always non-zero by the time any visitor
> reaches this callback, triggering the early return in
> opts_start_struct().  Might be slightly safer if you just did the
> g_malloc0() here, to make sure no caller ever ends up re-initializing
> ov->unprocessed_opts, but what you have works.
> 

In fact, the alternative that just does a local malloc was proposed here:
https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg04746.html

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-09-18 12:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07 12:08 [Qemu-devel] [PATCH 0/7] qapi-flattening and preparation of -audiodev option Kővágó, Zoltán
2015-09-07 12:08 ` [Qemu-devel] [PATCH 1/7] qapi: support implicit structs in OptsVisitor Kővágó, Zoltán
2015-09-17 20:30   ` Eric Blake
2015-09-18 12:26     ` Eric Blake [this message]
2015-09-07 12:08 ` [Qemu-devel] [PATCH 2/7] qapi: convert NumaOptions into a flat union Kővágó, Zoltán
2015-09-09 15:42   ` Eduardo Habkost
2015-09-07 12:08 ` [Qemu-devel] [PATCH 3/7] net: remove NetLegacy struct Kővágó, Zoltán
2015-09-15 14:54   ` Eric Blake
2015-09-07 12:14 ` [Qemu-devel] [PATCH 4/7] net: use Netdev instead of NetClientOptions in client init Kővágó, Zoltán
2015-09-09 15:46   ` Eric Blake
2015-09-07 12:14 ` [Qemu-devel] [PATCH 5/7] qapi: change Netdev into a flat union Kővágó, Zoltán
2015-09-17 20:41   ` Eric Blake
2015-09-07 12:14 ` [Qemu-devel] [PATCH 6/7] qapi: reorder NetdevBase and Netdev Kővágó, Zoltán
2015-09-17 20:42   ` Eric Blake
2015-09-07 12:14 ` [Qemu-devel] [PATCH 7/7] qapi: support nested structs in OptsVisitor Kővágó, Zoltán
2015-09-17 21:24   ` Eric Blake
2015-09-17 22:01     ` Kővágó Zoltán
2015-09-14 12:34 ` [Qemu-devel] [PATCH 0/7] qapi-flattening and preparation of -audiodev option Markus Armbruster

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=55FC030C.7040505@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dirty.ice.hu@gmail.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yanghy@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.