[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] vl: Partial support for non-scalar properti
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] vl: Partial support for non-scalar properties with -object |
Date: |
Thu, 10 Aug 2017 18:38:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 10/08/2017 18:36, Markus Armbruster wrote:
>>> + while (!QSIMPLEQ_EMPTY(&oo_queue)) {
>>> + ObjectOptionsQueueEntry *e = QSIMPLEQ_FIRST(&oo_queue);
>>> +
>>> + QSIMPLEQ_REMOVE_HEAD(&oo_queue, entry);
>>> + qapi_free_ObjectOptions(e->oo);
>>> + g_free(e);
>>> + }
>> Why not free the queue entry in object_create, and assert here that it's
>> empty?
>
> Assumes object_create_delayed(TYPE) == !object_create_initial(TYPE),
> which is the case. Fewer assumptions is good. Less code is also good.
> Pick your goodness, please :)
I think the assumption is not that object_create_delayed(TYPE) ==
!object_create_initial(TYPE), but rather that all -object options are
dealt with (and they shouldn't be dealt more than once). It's a
reasonable assumption, methinks. :)
Paolo
[Qemu-devel] [PATCH 1/2] vl: Factor object_create() out of main(), Markus Armbruster, 2017/08/10