[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 05/45] qdev: remove PropertyInfo.qtype field
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 05/45] qdev: remove PropertyInfo.qtype field |
Date: |
Wed, 7 Jun 2017 14:44:50 +0100 |
On 7 June 2017 at 14:09, Markus Armbruster <address@hidden> wrote:
> Peter Maydell <address@hidden> writes:
>> So how should I obtain those semantics with this cleanup in place ?
>
> Two ways come to mind:
>
> * Define a PropertyInfo like qdev_prop_uint32 with a null
> set_default_value(), and use that.
>
> * Add a flag to Property that makes qdev_property_add_static() skip
> prop->info->set_default_value(), set it for your property.
>
> Actually, I'd probably do it the other way: call ->set_default_value()
> only when the flag is set. No need to check it's non-null then.
> Setting the flag when it's null is a programming error.
>
> Could one of these two work for you?
The former would work but duplicates a pile of code from the
qdev_prop_uint32 implementation. The latter would be cleaner
but introduces a dependency on this series -- how close is it
to hitting master?
thanks
-- PMM