aboutsummaryrefslogtreecommitdiff
path: root/hw/pc_piix.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-28 18:12:47 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-18 15:14:37 +0200
commitbce544740a87cac1636f01c8a28502fec1694b3d (patch)
tree9967a3c299edcb4c32febe4019d7a98c5b205df2 /hw/pc_piix.c
parent3cb75a7cba7e808c0ae007e4d86750849642304e (diff)
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>
Diffstat (limited to 'hw/pc_piix.c')
-rw-r--r--hw/pc_piix.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index f49b0aaf89..d68f77a9c0 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -29,6 +29,7 @@
#include "apic.h"
#include "pci.h"
#include "pci_ids.h"
+#include "usb.h"
#include "net.h"
#include "boards.h"
#include "ide.h"
@@ -374,7 +375,7 @@ static QEMUMachine pc_machine_v1_1 = {
.property = "vapic",\
.value = "off",\
},{\
- .driver = "USB",\
+ .driver = TYPE_USB_DEVICE,\
.property = "full-path",\
.value = "no",\
}
@@ -447,7 +448,7 @@ static QEMUMachine pc_machine_v0_14 = {
#define PC_COMPAT_0_13 \
PC_COMPAT_0_14,\
{\
- .driver = "PCI",\
+ .driver = TYPE_PCI_DEVICE,\
.property = "command_serr_enable",\
.value = "off",\
},{\
@@ -519,7 +520,7 @@ static QEMUMachine pc_machine_v0_12 = {
.property = "vectors",\
.value = stringify(0),\
},{\
- .driver = "PCI",\
+ .driver = TYPE_PCI_DEVICE,\
.property = "rombar",\
.value = stringify(0),\
}