mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qdev: Move bus properties to abstract superclasses
In qdev, each bus in practice identified an abstract superclass, but this was mostly hidden. In QOM, instead, these abstract classes are explicit so we can move bus properties there. All bus property walks are removed, and all device property walks are changed to look along the class hierarchy instead. We would have duplicates if class A defines some properties and its subclass B does not define any, because class_b->props will be left equal to class_a->props. The solution here is to reintroduce the class_base_init TypeInfo callback, that was present in one of the early QOM versions but removed (on my request...) before committing. This breaks global bus properties, an obscure feature when used with the command-line which is actually useful and used when used by backwards-compatible machine types. So this patch also adjusts the global bus properties in hw/pc_piix.c to refer to the abstract class. Globals and other properties must be modified in the same patch to avoid complications related to initialization ordering. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
3cb75a7cba
commit
bce544740a
14 changed files with 73 additions and 83 deletions
|
@ -1063,7 +1063,6 @@ static Property ccid_props[] = {
|
|||
static struct BusInfo ccid_bus_info = {
|
||||
.name = "ccid-bus",
|
||||
.size = sizeof(CCIDBus),
|
||||
.props = ccid_props,
|
||||
};
|
||||
|
||||
void ccid_card_send_apdu_to_guest(CCIDCardState *card,
|
||||
|
@ -1347,6 +1346,7 @@ static void ccid_card_class_init(ObjectClass *klass, void *data)
|
|||
k->bus_info = &ccid_bus_info;
|
||||
k->init = ccid_card_init;
|
||||
k->exit = ccid_card_exit;
|
||||
k->props = ccid_props;
|
||||
}
|
||||
|
||||
static TypeInfo ccid_card_type_info = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue