[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc |
Date: |
Fri, 15 Feb 2013 16:14:49 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Il 15/02/2013 14:48, Peter Maydell ha scritto:
>>> >> If you prefer we could standardize on
>>> >> typedef struct {
>>> >> ParentClass parent;
>>> >> } FooClass;
>>> >>
>>> >> rather than typedef ParentClass FooClass;
>> > It may need rework either way. Because aliasing via typedef gives
>> > FooClass fields it will loose once it is turned into a real QOM class.
>> > We had such an issue with i440fx in my PHB series, that's why I'm
>> > sensitive to it. ;)
> OK, so that seems like an argument for always defining the
> empty-except-for-the-parentclass class struct, or does that
> run into problems too?
I like the empty-except-for-parentclass. OTOH, if you have no fields
you will not use FOO_CLASS. You will only use PARENT_CLASS, and those
uses will be fine even after you start having a FooClass.
So, having no typedef and no _CLASS macros at all is simple and should
be acceptable.
But if you have a typedef, you should a) make it a struct, b) add the
_CLASS macros.
Paolo
- [Qemu-devel] [PATCH 0/5] Remove sysbus_add_memory and sysbus_del_memory, Peter Maydell, 2013/02/15
- [Qemu-devel] [PATCH 1/5] sysbus: make SysBusDeviceClass::init optional, Peter Maydell, 2013/02/15
- [Qemu-devel] [PATCH 5/5] sysbus: Remove sysbus_add_memory and sysbus_del_memory, Peter Maydell, 2013/02/15
- [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Peter Maydell, 2013/02/15
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Andreas Färber, 2013/02/15
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Peter Maydell, 2013/02/15
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Andreas Färber, 2013/02/15
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Peter Maydell, 2013/02/15
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Andreas Färber, 2013/02/15
- Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc, Peter Maydell, 2013/02/15
[Qemu-devel] [PATCH 3/5] milkymist-minimac2: Just expose buffers as a sysbus mmio region, Peter Maydell, 2013/02/15
[Qemu-devel] [PATCH 4/5] milkymist-softusb: Don't map RAM memory regions in the device itself, Peter Maydell, 2013/02/15