[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 0/9] QOM: qomify -netdev
From: |
Zhi Yong Wu |
Subject: |
Re: [Qemu-devel] [RFC 0/9] QOM: qomify -netdev |
Date: |
Mon, 26 Mar 2012 22:20:33 +0800 |
On Mon, Mar 26, 2012 at 7:54 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Mon, Mar 26, 2012 at 6:40 AM, <address@hidden> wrote:
>> From: Zhi Yong Wu <address@hidden>
>>
>> Sending the patchset is mainly intended to get some comments and void the
>> wrong development direction.
>>
>> The patchset is used to qomify -netdev, but it introduce one infrastructure
>> for host devices based on raw Class and Object, not qdev. So they are not
>> related with DeviceClass and DeviceState.
>>
>> patch #1 introduce one new class and object for host devices.
>
> A common infrastructure for host devices is useful. The Property
> mechanism in hw/qdev-properties.c is especially good. I think host
> devices will also need to 2-step creation process (init and realize).
Yeah.
>
> I think the qdev-properties.c code can mostly be shared. It currently
> uses the qdev DeviceState class but I think it only really access the
> Property array.
struct Property {
const char *name;
PropertyInfo *info;
int offset;
uint8_t bitnr;
uint8_t qtype;
int64_t defval;
};
struct PropertyInfo {
const char *name;
const char *legacy_name;
const char **enum_table;
int64_t min;
int64_t max;
int (*parse)(DeviceState *dev, Property *prop, const char *str);
int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len);
ObjectPropertyAccessor *get;
ObjectPropertyAccessor *set;
ObjectPropertyRelease *release;
};
Like above, its member functions pointers use DeviceState, so we will
have to consider how to make this PropertyInfo more generic and be
used by other Class and Object which are not based on DeviceState.
>
> Therefore it should be possible to really share a single copy of the
> code. We don't need to duplicate Property for host devices, instead
> we can extract it out of hw/.
Yeah, but we need to make some effort to reach this goal.
>
> Stefan
--
Regards,
Zhi Yong Wu
- Re: [Qemu-devel] [RFC 2/9] net: introduce one net host device class, (continued)
- [Qemu-devel] [RFC 6/9] net: qomify -netdev user, zwu . kernel, 2012/03/26
- [Qemu-devel] [PATCH] net: qomify -netdev, zwu . kernel, 2012/03/26
- [Qemu-devel] [RFC 7/9] net: qomify -netdev socket, zwu . kernel, 2012/03/26
- [Qemu-devel] [RFC 8/9] net: qomify -netdev vde, zwu . kernel, 2012/03/26
- [Qemu-devel] [RFC 5/9] net: adjust dump init API, zwu . kernel, 2012/03/26
- [Qemu-devel] [RFC 9/9] net: qomify -netdev tap & -netdev bridge, zwu . kernel, 2012/03/26
- Re: [Qemu-devel] [RFC 0/9] QOM: qomify -netdev, Stefan Hajnoczi, 2012/03/26
- Re: [Qemu-devel] [RFC 0/9] QOM: qomify -netdev,
Zhi Yong Wu <=
- Re: [Qemu-devel] [RFC 0/9] QOM: qomify -netdev, Andreas Färber, 2012/03/26