Am 30.11.2011 22:03, schrieb Anthony Liguori:
+
+void qdev_property_add(DeviceState *dev, const char *name, const char *type,
+ DevicePropertyEtter *get, DevicePropertyEtter *set,
+ DevicePropertyRelease *release, void *opaque,
+ Error **errp)
How about letting the caller pass in a DeviceProperty for improved
readability and usability? Instead of memorizing the order of currently
eight parameters (could probably become more in the future) you can use
proper C99 initializers then.
@@ -45,6 +82,7 @@ struct DeviceState {
QTAILQ_ENTRY(DeviceState) sibling;
int instance_id_alias;
int alias_required_for_version;
+ GSList *properties;
};
Why GSList instead of qemu-queue.h macros that would provide type safety?
I don't think a property can belong to multiple devices, can it?
qdev_property_add only refers to a single device, and nothing else adds
elements to the list.
Kevin