[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on com
From: |
Halil Pasic |
Subject: |
Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names |
Date: |
Mon, 12 Dec 2016 19:00:35 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 12/12/2016 06:47 PM, Eduardo Habkost wrote:
>>>> + */
>>> I think this should not just be a 'temporary hack'... rather document
>>> this behaviour for abstract classes?
>>>
>> Connie, I have to disagree with you on this. I'm fine with this as a
>> temporary hack provided it remedies the acute problem, but I would this
>> becoming state of art.
>>
>> The reason for this how abstract class is usually understood in OOP:
>> it's like a normal class except you can not instantiate it. Adding an
>> extra property rule, and especially such a convoluted one, could result
>> in a conflict between intuition and reality. And it's not like we have
>> no plan how to do this cleanly.
>>
>> Why do I say convoluted:
>> * Inheriting form abstract and from non-abstract behaves differently.
>> * Theoretically we have something like non-abstract (C_3) inherits for
>> abstract (AC_2) inherits from non-abstract (C_1) inherits from abstract
>> (AC_0), and we set the property P both via AC_0 and AC_2 for an instance
>> of C1 we would/could end up having the same problem as we have now (via
>> AC_0 taking precedence over AC_2) -- at least I think so.
> Well, we could change the code to:
> 1) Not check object_class_is_abstract(), and simply register the
> globals for all subtypes;
> 2) Call qdev_prop_set_globals_for_type() only for
> object_class_get_name(), instead of doing it for all
> parent classes in qdev_prop_set_globals().
>
> But this sounds like a more complicated way of implementing
> exactly the same behavior implemented by Greg Kurz in "qdev: fix
> the order compat and global properties are applied".
>
Yeah. This is what I meant with "And it's not like we have
no plan how to do this cleanly.", was trying to convince Connie
that this called a hack for a reason. I think we are on the same
page. I think this is a really good way to solve the acute problem
with a small LOC number.
Halil
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, (continued)
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Eduardo Habkost, 2016/12/09
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Cornelia Huck, 2016/12/12
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Greg Kurz, 2016/12/12
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Cornelia Huck, 2016/12/12
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Eduardo Habkost, 2016/12/12
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Halil Pasic, 2016/12/12
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names, Eduardo Habkost, 2016/12/12
- Re: [Qemu-devel] [RFC for-2.8] machine: Convert abstract typename on compat_props to subclass names,
Halil Pasic <=
Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Michael S. Tsirkin, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Eduardo Habkost, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Michael S. Tsirkin, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Eduardo Habkost, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Michael S. Tsirkin, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Eduardo Habkost, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Stefan Hajnoczi, 2016/12/06
- Re: [Qemu-devel] [PATCH] virtio: fix HW_COMPAT_2_6 macro for virtio-*-pci drivers, Greg Kurz, 2016/12/07