[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: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] vl: Partial support for non-scalar properties with -object |
Date: |
Fri, 11 Aug 2017 08:20:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Paolo Bonzini <address@hidden> writes:
> 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. :)
Okay.
[Qemu-devel] [PATCH 1/2] vl: Factor object_create() out of main(), Markus Armbruster, 2017/08/10