qdev class properties + abstract class support on device-list-properties
Subsystems (8)
v4 cover qdev class properties + abstract class support on device-list-properties
Changes v3 -> v4:
* FIx "make check" failures:
* Fix e1000e initialization ordering (fixes tests/device-introspect-test failure)
* Reported-by: Igor Mammedov <[email protected]>
* Call prop->info->release on instance_finalize (fixes tests/drive_del-test failure)
* See individual patches for other minor/style changes
Changes v2 -> v3:
* Small alignment fix in patch 3/6
* Included patches from "tests: A few check-qom-proplist fixes" in the series
* Rebased to latest qemu.git master
Changes v1 -> v2:
* s/qdev_class_set_props/device_class_set_props/
* Suggested-by: Andreas Färber <[email protected]>
A git branch containing this series can be seen at:
https://github.com/ehabkost/qemu-hacks.git work/device-list-abstract-properties
Eduardo Habkost (8):
tests: check-qom-proplist: Remove duplicate "bv" property
tests: check-qom-proplist: Use &error_abort to catch errors
qdev: device_class_set_props() function
qdev: Extract property-default code to qdev_property_set_to_default()
qdev: Register static properties as class properties
qom: object_class_property_iter_init() function
qmp: Support abstract classes on device-list-properties
qdev: Warning about using qdev_property_add_static() in new code
hw/9pfs/virtio-9p-device.c | 2 +- hw/acpi/piix4.c | 2 +- hw/arm/armv7m.c | 2 +- hw/arm/bcm2836.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/pxa2xx.c | 4 +- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stm32f205_soc.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/xlnx-zynqmp.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/hda-codec.c | 2 +- hw/audio/intel-hda.c | 4 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/pl041.c | 2 +- hw/audio/sb16.c | 2 +- hw/block/fdc.c | 8 +-- hw/block/m25p80.c | 2 +- hw/block/nand.c | 2 +- hw/block/nvme.c | 2 +- hw/block/onenand.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/pflash_cfi02.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/char/bcm2835_aux.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/debugcon.c | 2 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/parallel.c | 2 +- hw/char/pl011.c | 2 +- hw/char/sclpconsole-lm.c | 2 +- hw/char/sclpconsole.c | 2 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci.c | 6 +- hw/char/spapr_vty.c | 2 +- hw/char/stm32f2xx_usart.c | 2 +- hw/char/virtio-console.c | 2 +- hw/char/virtio-serial-bus.c | 4 +- hw/char/xilinx_uartlite.c | 2 +- hw/core/generic-loader.c | 2 +- hw/core/or-irq.c | 2 +- hw/core/platform-bus.c | 2 +- hw/core/qdev.c | 125 ++++++++++++++++++++++++++++++------ hw/cpu/a15mpcore.c | 2 +- hw/cpu/a9mpcore.c | 2 +- hw/cpu/arm11mpcore.c | 2 +- hw/cpu/realview_mpcore.c | 2 +- hw/display/bcm2835_fb.c | 2 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 4 +- hw/display/g364fb.c | 2 +- hw/display/milkymist-vgafb.c | 2 +- hw/display/qxl.c | 2 +- hw/display/tcx.c | 2 +- hw/display/vga-isa.c | 2 +- hw/display/vga-pci.c | 4 +- hw/display/virtio-gpu-pci.c | 2 +- hw/display/virtio-gpu.c | 2 +- hw/display/virtio-vga.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/pxa2xx_dma.c | 2 +- hw/dma/sparc32_dma.c | 2 +- hw/dma/sun4m_iommu.c | 2 +- hw/dma/xilinx_axidma.c | 2 +- hw/gpio/imx_gpio.c | 2 +- hw/gpio/omap_gpio.c | 4 +- hw/i2c/core.c | 2 +- hw/i2c/omap_i2c.c | 2 +- hw/i2c/smbus_eeprom.c | 2 +- hw/i386/intel_iommu.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvm/ioapic.c | 2 +- hw/i386/kvm/pci-assign.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/cmd646.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/mmio.c | 2 +- hw/ide/qdev.c | 8 +-- hw/input/milkymist-softusb.c | 2 +- hw/input/virtio-input-hid.c | 2 +- hw/input/virtio-input-host.c | 2 +- hw/input/virtio-input.c | 2 +- hw/input/vmmouse.c | 2 +- hw/intc/apic_common.c | 2 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/arm_gicv2m.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/exynos4210_combiner.c | 2 +- hw/intc/exynos4210_gic.c | 4 +- hw/intc/grlib_irqmp.c | 2 +- hw/intc/i8259_common.c | 2 +- hw/intc/ioapic.c | 2 +- hw/intc/mips_gic.c | 2 +- hw/intc/omap_intc.c | 4 +- hw/intc/openpic.c | 2 +- hw/intc/openpic_kvm.c | 2 +- hw/intc/xilinx_intc.c | 2 +- hw/ipack/ipack.c | 2 +- hw/ipmi/ipmi.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/isa/pc87312.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/mips/cps.c | 2 +- hw/misc/a9scu.c | 2 +- hw/misc/applesmc.c | 2 +- hw/misc/arm11scu.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/arm_sysctl.c | 2 +- hw/misc/aspeed_scu.c | 2 +- hw/misc/aspeed_sdmc.c | 2 +- hw/misc/bcm2835_property.c | 2 +- hw/misc/debugexit.c | 2 +- hw/misc/eccmemctl.c | 2 +- hw/misc/ivshmem.c | 6 +- hw/misc/macio/cuda.c | 2 +- hw/misc/macio/macio.c | 2 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_cpc.c | 2 +- hw/misc/mips_itu.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000e.c | 3 +- hw/net/eepro100.c | 2 +- hw/net/etraxfs_eth.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 2 +- hw/net/lance.c | 2 +- hw/net/milkymist-minimac2.c | 2 +- hw/net/mipsnet.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/net/ne2000.c | 2 +- hw/net/opencores_eth.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/spapr_llan.c | 2 +- hw/net/stellaris_enet.c | 2 +- hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 2 +- hw/net/xgmac.c | 2 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/nvram/ds1225y.c | 2 +- hw/nvram/fw_cfg.c | 4 +- hw/nvram/mac_nvram.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/pci-bridge/ioh3420.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 4 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-host/piix.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/prep.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci.c | 2 +- hw/pci/pcie_port.c | 4 +- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 2 +- hw/ppc/spapr_rng.c | 2 +- hw/ppc/spapr_vio.c | 2 +- hw/s390x/css-bridge.c | 2 +- hw/s390x/ipl.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/virtio-ccw.c | 18 +++--- hw/scsi/megasas.c | 2 +- hw/scsi/mptsas.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/scsi/scsi-disk.c | 8 +-- hw/scsi/scsi-generic.c | 2 +- hw/scsi/spapr_vscsi.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/sd/sd.c | 2 +- hw/sd/sdhci.c | 4 +- hw/sparc/sun4m.c | 4 +- hw/sparc64/sun4u.c | 4 +- hw/ssi/aspeed_smc.c | 2 +- hw/ssi/xilinx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- hw/timer/a9gtimer.c | 2 +- hw/timer/allwinner-a10-pit.c | 2 +- hw/timer/arm_mptimer.c | 2 +- hw/timer/arm_timer.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/i8254.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/m48t59.c | 4 +- hw/timer/mc146818rtc.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/pxa2xx_timer.c | 4 +- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/xilinx_timer.c | 2 +- hw/tpm/tpm_tis.c | 2 +- hw/usb/bus.c | 2 +- hw/usb/ccid-card-emulated.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-audio.c | 2 +- hw/usb/dev-hid.c | 6 +- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 4 +- hw/usb/dev-smartcard-reader.c | 4 +- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ohci.c | 4 +- hw/usb/hcd-uhci.c | 4 +- hw/usb/hcd-xhci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/pci.c | 2 +- hw/vfio/platform.c | 2 +- hw/virtio/vhost-vsock.c | 2 +- hw/virtio/virtio-balloon.c | 2 +- hw/virtio/virtio-mmio.c | 2 +- hw/virtio/virtio-pci.c | 20 +++--- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- hw/xen/xen_backend.c | 2 +- hw/xen/xen_pt.c | 2 +- include/hw/qdev-core.h | 6 ++ include/qom/object.h | 14 ++++ qmp.c | 21 +++--- qom/object.c | 10 ++- target-arm/cpu.c | 2 +- target-i386/cpu.c | 4 +- target-microblaze/cpu.c | 2 +- target-ppc/translate_init.c | 6 +- tests/check-qom-proplist.c | 46 +++++++++---- tests/test-qdev-global-props.c | 2 +- 267 files changed, 493 insertions(+), 362 deletions(-)
Signature · 1 line
2.7.4
PATCH v4 1/8 tests: check-qom-proplist: Remove duplicate "bv" property
The object_property_add_bool() call in dummy_init() is always failing because there is an existing "bv" class property. We need to remove either the "bv" class property or the "bv" instance property.
Remove the class property so both object properties and class properties are covered by the test code.
---
Changes series v2 -> v3:
* Patch imported from "tests: A few check-qom-proplist fixes" series
* Reworded commit message for clarity
Changes series v3 -> v4:
* (none)
--- tests/check-qom-proplist.c | 4 ---- 1 file changed, 4 deletions(-)
tests/check-qom-proplist.c +0 -4
@@ -129,10 +129,6 @@ static void dummy_init(Object *obj)static void dummy_class_init (ObjectClass *cls,void *data) { -object_class_property_add_bool (cls,"bv" , - dummy_get_bv, - dummy_set_bv, -NULL ); object_class_property_add_str(cls, "sv", dummy_get_sv, dummy_set_sv,
Signature · 1 line
2.7.4
PATCH v4 2/8 tests: check-qom-proplist: Use &error_abort to catch errors
In reply to Eduardo HabkostUse &error_abort so we don't ignore any errors on the property registration calls.
---
Changes series v2 -> v3:
* Patch imported from "tests: A few check-qom-proplist fixes" series
Changes series v3 -> v4:
* Added &error_abort to more object_property_{add,del}_*() calls
* Suggested-by: Igor Mammedov <[email protected]>
--- tests/check-qom-proplist.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/check-qom-proplist.c +7 -7
@@ -123,7 +123,7 @@ static void dummy_init(Object *obj)object_property_add_bool (obj,"bv" , dummy_get_bv, dummy_set_bv, -NULL ); + &error_abort); }
@@ -132,13 +132,13 @@ static void dummy_class_init(ObjectClass *cls, void *data)object_class_property_add_str (cls,"sv" , dummy_get_sv, dummy_set_sv, -NULL ); + &error_abort);object_class_property_add_enum (cls,"av" ,"DummyAnimal" , dummy_animal_map, dummy_get_av, dummy_set_av, -NULL ); + &error_abort); }
@@ -239,13 +239,13 @@ static void dummy_dev_init(Object *obj)DummyBus *bus =DUMMY_BUS (object_new (TYPE_DUMMY_BUS ));DummyBackend *backend =DUMMY_BACKEND (object_new (TYPE_DUMMY_BACKEND )); -object_property_add_child (obj,"bus" ,OBJECT (bus),NULL ); +object_property_add_child (obj,"bus" ,OBJECT (bus), &error_abort); dev->bus = bus; -object_property_add_child (OBJECT (bus),"backend" ,OBJECT (backend),NULL ); +object_property_add_child (OBJECT (bus),"backend" ,OBJECT (backend), &error_abort); bus->backend = backend;object_property_add_link (obj,"backend" ,TYPE_DUMMY_BACKEND , - (Object **)&bus->backend,NULL ,0 ,NULL ); + (Object **)&bus->backend,NULL ,0 , &error_abort); }static void dummy_dev_unparent (Object *obj)
@@ -274,7 +274,7 @@ static void dummy_bus_init(Object *obj)static void dummy_bus_unparent (Object *obj) {DummyBus *bus =DUMMY_BUS (obj); -object_property_del (obj->parent,"backend" ,NULL ); +object_property_del (obj->parent,"backend" , &error_abort);object_unparent (OBJECT (bus->backend)); }
Signature · 1 line
2.7.4
PATCH v4 4/8 qdev: Extract property-default code to qdev_property_set_to_default()
In reply to Eduardo HabkostThe code that registers qdev properties will be split from the code that initializes default values on instance_init, so move it to a separate function.
---
Changes series v1 -> v4:
* (none)
--- hw/core/qdev.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-)
hw/core/qdev.c +29 -12
@@ -775,6 +775,34 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, }/** +* qdev_property_set_to_default: +* @dev: Device where the property will be reset +* @prop: The qdev property definition +* @errp: location to store error information +* +* Reset the value of property @prop in @dev to its default value. +* On error, store error in @errp. +*/ +static void qdev_property_set_to_default (DeviceState *dev,Property *prop, +Error **errp) +{ +Object *obj =OBJECT (dev); + +if (prop->qtype ==QTYPE_NONE ) { +return ; + } + +if (prop->qtype ==QTYPE_QBOOL ) { +object_property_set_bool (obj, prop->defval, prop->name, errp); + }else if (prop->info->enum_table) { +object_property_set_str (obj, prop->info->enum_table[prop->defval], + prop->name, errp); + }else if (prop->qtype ==QTYPE_QINT ) { +object_property_set_int (obj, prop->defval, prop->name, errp); + } +} + +/** * qdev_property_add_static: * @dev: Device to add the property to. * @prop: The qdev property definition.
@@ -813,18 +841,7 @@ void qdev_property_add_static(DeviceState *dev, Property *prop, prop->info->description, &error_abort); -if (prop->qtype ==QTYPE_NONE ) { -return ; - } - -if (prop->qtype ==QTYPE_QBOOL ) { -object_property_set_bool (obj, prop->defval, prop->name, &error_abort); - }else if (prop->info->enum_table) { -object_property_set_str (obj, prop->info->enum_table[prop->defval], - prop->name, &error_abort); - }else if (prop->qtype ==QTYPE_QINT ) { -object_property_set_int (obj, prop->defval, prop->name, &error_abort); - } +qdev_property_set_to_default (dev, prop, &error_abort); }/* @qdev_alias_all_properties - Add alias properties to the source object for
Signature · 1 line
2.7.4
PATCH v4 5/8 qdev: Register static properties as class properties
In reply to Eduardo HabkostInstead of registering qdev static properties on instance_init, register them as class properties, at qdev_class_set_props().
qdev_property_add_legacy() was replaced by an equivalent qdev_class_property_add_legacy() function. qdev_property_add_static(), on the other hand, can't be eliminated yet because it is used by arm_cpu_post_init().
As class properties don't have a release function called when an object instance is destroyed, the release functions for properties are called manually from device_finalize().
---
Changes series v1 -> v2:
* (none)
Changes v2 -> v3:
* Fix code alignemnt
* Reported-by: Igor Mammedov <[email protected]>
Changes series v3 -> v4:
* s/Device/Class/ on qdev_class_property_add_legacy() doc comment
* Reported-by: Igor Mammedov <[email protected]>
* Call prop->info->release on instance_finalize (fix tests/drive_del-test failure)
--- hw/core/qdev.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 13 deletions(-)
hw/core/qdev.c +69 -13
@@ -739,12 +739,12 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, }/** -* qdev_property_add_legacy: -* @dev: Device to add the property to. +* qdev_class_property_add_legacy: +* @oc: Class to add the property to. * @prop: The qdev property definition. * @errp: location to store error information. * -* Add a legacy QOM property to @dev for qdev property @prop. +* Add a legacy QOM property to @oc for qdev property @prop. * On error, store error in @errp. * * Legacy properties are string versions of QOM properties. The format of
@@ -754,8 +754,8 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,* Do not use this is new code! QOM Properties added through this interface * will be given names in the "legacy" namespace. */ -static void qdev_property_add_legacy (DeviceState *dev,Property *prop, -Error **errp) +static void qdev_class_property_add_legacy (ObjectClass *oc,Property *prop, +Error **errp) {gchar *name;
@@ -765,11 +765,12 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, } name =g_strdup_printf ("legacy-%s" , prop->name); -object_property_add (OBJECT (dev), name,"str" , - prop->info->print ? qdev_get_legacy_property : prop->info->get, -NULL , -NULL , - prop, errp); +object_class_property_add (oc, name,"str" , + prop->info->print ? + qdev_get_legacy_property : + prop->info->get, +NULL ,NULL , + prop, errp);g_free (name); }
@@ -844,6 +845,48 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,qdev_property_set_to_default (dev, prop, &error_abort); } +/** +* qdev_class_property_add_static: +* @oc: Class to add the property to. +* @prop: The qdev property definition. +* @errp: location to store error information. +* +* Add a static QOM property to @oc for qdev property @prop. +* On error, store error in @errp. Static properties access data in a struct. +* The type of the QOM property is derived from prop->info. +*/ +static void qdev_class_property_add_static (ObjectClass *oc,Property *prop, +Error **errp) +{ +Error *local_err =NULL ; + +/* +* TODO qdev_prop_ptr does not have getters or setters. It must +* go now that it can be replaced with links. The test should be +* removed along with it: all static properties are read/write. +*/ +if (!prop->info->get && !prop->info->set) { +return ; + } + +/* Note: prop->info->release is called on device_finalize(), +* because it needs to be called on instaqnce destruction, not on +* class property removal. +*/ +object_class_property_add (oc, prop->name, prop->info->name, + prop->info->get, prop->info->set, +NULL , prop, &local_err); + +if (local_err) { +error_propagate (errp, local_err); +return ; + } + +object_class_property_set_description (oc, prop->name, + prop->info->description, + &error_abort); +} +/* @qdev_alias_all_properties - Add alias properties to the source object for * all qdev properties on the target DeviceState. */
@@ -867,8 +910,15 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)void device_class_set_props (DeviceClass *dc,Property *props) { +Property *prop; +ObjectClass *oc =OBJECT_CLASS (dc); +assert (!dc->props); dc->props = props; +for (prop = dc->props; prop && prop->name; prop++) { +qdev_class_property_add_legacy (oc, prop, &error_abort); +qdev_class_property_add_static (oc, prop, &error_abort); + } }static int qdev_add_hotpluggable_device (Object *obj,void *opaque)
@@ -1068,8 +1118,7 @@ static void device_initfn(Object *obj) class =object_get_class (OBJECT (dev));do {for (prop =DEVICE_CLASS (class)->props; prop && prop->name; prop++) { -qdev_property_add_legacy (dev, prop, &error_abort); -qdev_property_add_static (dev, prop, &error_abort); +qdev_property_set_to_default (dev, prop, &error_abort); } class =object_class_get_parent (class); }while (class !=object_class_by_name (TYPE_DEVICE ));
@@ -1088,9 +1137,16 @@ static void device_post_init(Object *obj)/* Unlink device from bus and free the structure. */ static void device_finalize (Object *obj) { +DeviceState *dev =DEVICE (obj); +DeviceClass *dc =DEVICE_GET_CLASS (dev); +Property *prop;NamedGPIOList *ngl, *next; -DeviceState *dev =DEVICE (obj); +for (prop = dc->props; prop && prop->name; prop++) { +if (prop->info->release) { + prop->info->release (obj, prop->name, prop); + } + } QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {QLIST_REMOVE (ngl, node);
Signature · 1 line
2.7.4
PATCH v4 6/8 qom: object_class_property_iter_init() function
In reply to Eduardo HabkostThe new function will allow us to iterate over class properties using the same logic we use for object properties. Unit test included.
---
Changes series v1 -> v3:
* (none)
Changes series v3 -> v4:
* Trivial whitespace change (removed extra newline)
--- include/qom/object.h | 14 ++++++++++++++ qom/object.c | 10 ++++++++-- tests/check-qom-proplist.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-)
include/qom/object.h +14 -0
@@ -995,6 +995,20 @@ void object_property_iter_init(ObjectPropertyIterator *iter, Object *obj);/** +* object_class_property_iter_init: +* @klass: the class +* +* Initializes an iterator for traversing all properties +* registered against an object class and all parent classes. +* +* It is forbidden to modify the property list while iterating, +* whether removing or adding properties. +*/ +void object_class_property_iter_init (ObjectPropertyIterator *iter, +ObjectClass *klass); + + +/** * object_property_iter_next: * @iter: the iterator instance *
qom/object.c +8 -2
@@ -1010,6 +1010,13 @@ void object_property_iter_init(ObjectPropertyIterator *iter, iter->nextclass =object_get_class (obj); } +void object_class_property_iter_init (ObjectPropertyIterator *iter, +ObjectClass *klass) +{ +g_hash_table_iter_init (&iter->iter, klass->properties); + iter->nextclass =object_class_get_parent (klass); +} +ObjectProperty *object_property_iter_next (ObjectPropertyIterator *iter) {gpointer key, val;
@@ -1017,8 +1024,7 @@ ObjectProperty *object_property_iter_next(ObjectPropertyIterator *iter)if (!iter->nextclass) {return NULL ; } -g_hash_table_iter_init (&iter->iter, iter->nextclass->properties); - iter->nextclass =object_class_get_parent (iter->nextclass); +object_class_property_iter_init (iter, iter->nextclass); }return val; }
tests/check-qom-proplist.c +28 -0
@@ -496,6 +496,33 @@ static void test_dummy_iterator(void) } +static void test_dummy_class_iterator (void ) +{ +ObjectClass *klass =object_class_by_name (TYPE_DUMMY ); +ObjectProperty *prop; +ObjectPropertyIterator iter; +bool seensv = false, seenav = false, seentype; + +object_class_property_iter_init (&iter, klass); +while ((prop =object_property_iter_next (&iter))) { +if (g_str_equal (prop->name,"sv" )) { + seensv = true; + }else if (g_str_equal (prop->name,"av" )) { + seenav = true; + }else if (g_str_equal (prop->name,"type" )) { +/* This prop comes from the base Object class */ + seentype = true; + }else { +g_printerr ("Found prop '%s'\n" , prop->name); +g_assert_not_reached (); + } + } +g_assert (seenav); +g_assert (seensv); +g_assert (seentype); +} + +static void test_dummy_delchild (void ) {Object *parent =object_get_objects_root ();
@@ -524,6 +551,7 @@ int main(int argc, char **argv)g_test_add_func ("/qom/proplist/badenum" , test_dummy_badenum);g_test_add_func ("/qom/proplist/getenum" , test_dummy_getenum);g_test_add_func ("/qom/proplist/iterator" , test_dummy_iterator); +g_test_add_func ("/qom/proplist/class_iterator" , test_dummy_class_iterator);g_test_add_func ("/qom/proplist/delchild" , test_dummy_delchild);return g_test_run ();
Signature · 1 line
2.7.4
PATCH v4 7/8 qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostWhen an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
---
Changes series v1 -> v2:
* (none)
Changes series v2 -> v3:
* Reworded commit message
Changes series v3 -> v4:
* (none)
--- qmp.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
qmp.c +9 -12
@@ -518,7 +518,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, Error **errp) {ObjectClass *klass; -Object *obj; +Object *obj =NULL ;ObjectProperty *prop;ObjectPropertyIterator iter;DevicePropertyInfoList *prop_list =NULL ;
@@ -537,19 +537,16 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, }if (object_class_is_abstract (klass)) { -error_setg (errp,QERR_INVALID_PARAMETER_VALUE ,"name" , -"non-abstract device type" ); -return NULL ; - } - -if (DEVICE_CLASS (klass)->cannot_destroy_with_object_finalize_yet) { -error_setg (errp,"Can't list properties of device '%s'" , typename); -return NULL ; +object_class_property_iter_init (&iter, klass); + }else { +if (DEVICE_CLASS (klass)->cannot_destroy_with_object_finalize_yet) { +error_setg (errp,"Can't list properties of device '%s'" , typename); +return NULL ; + } + obj =object_new (typename); +object_property_iter_init (&iter, obj); } - obj =object_new (typename); - -object_property_iter_init (&iter, obj);while ((prop =object_property_iter_next (&iter))) {DevicePropertyInfo *info;DevicePropertyInfoList *entry;
Signature · 1 line
2.7.4
PATCH v4 8/8 qdev: Warning about using qdev_property_add_static() in new code
In reply to Eduardo HabkostThe only remaining user of qdev_property_add_static() is arm_cpu_post_init(), but removing it may take some work. While we don't change it, warn people to not use the function in new code.
---
Changes series v1 -> v3:
* (none)
Changes series v3 -> v4:
* Rewrote commit message to refer to correct function name
* s/qdev_class_set_props/device_class_set_props/ (function had been renamed in series v3)
--- hw/core/qdev.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/core/qdev.c +4 -0
@@ -812,6 +812,10 @@ static void qdev_property_set_to_default(DeviceState *dev, Property *prop,* Add a static QOM property to @dev for qdev property @prop. * On error, store error in @errp. Static properties access data in a struct. * The type of the QOM property is derived from prop->info. +* +* Do not use this in new code. Either use device_class_set_props(), +* or register regular QOM properties using object_property_add() or +* object_class_property_add(). */ void qdev_property_add_static (DeviceState *dev,Property *prop,Error **errp)
Signature · 1 line
2.7.4
PATCH v4 3/8 qdev: device_class_set_props() function
In reply to Eduardo HabkostReplace direct assignment of DeviceClass::props with a device_class_set_props() function. The new function will handle registration of class properties, later.
Most of the existing code was converted using the Coccinelle patch below. Exceptions are:
* manual conversion of target-ppc/translate_init.c;
* reordering of code at e1000e_class_init() to ensure device_class_set_props() is called after initialization of the PropertyInfo structs.
Coccinelle patch:
@@ identifier DC; expression PROPS; typedef DeviceClass; @@ DeviceClass *DC; ... -DC->props = PROPS; +device_class_set_props(DC, PROPS);
---
Changes v1 -> v2:
* s/qdev_class_set_props/device_class_set_props/
* Suggested-by: Andreas Färber <[email protected]>
Changes v2 -> v3:
* Rebased to latest qemu.git master
Changes v3 -> v4:
* Fix e1000e initialization ordering (fixes "make check" failure)
* Reported-by: Igor Mammedov <[email protected]>
* Rebased to latest qemu.git master (new functions changed:
floppy_drive_class_init(), pnv_chip_class_init(), pnv_core_class_init())
--- hw/9pfs/virtio-9p-device.c | 2 +- hw/acpi/piix4.c | 2 +- hw/arm/armv7m.c | 2 +- hw/arm/bcm2836.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/pxa2xx.c | 4 ++-- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stm32f205_soc.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/xlnx-zynqmp.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/hda-codec.c | 2 +- hw/audio/intel-hda.c | 4 ++-- hw/audio/marvell_88w8618.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/pl041.c | 2 +- hw/audio/sb16.c | 2 +- hw/block/fdc.c | 8 ++++---- hw/block/m25p80.c | 2 +- hw/block/nand.c | 2 +- hw/block/nvme.c | 2 +- hw/block/onenand.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/pflash_cfi02.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/char/bcm2835_aux.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/debugcon.c | 2 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/parallel.c | 2 +- hw/char/pl011.c | 2 +- hw/char/sclpconsole-lm.c | 2 +- hw/char/sclpconsole.c | 2 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci.c | 6 +++--- hw/char/spapr_vty.c | 2 +- hw/char/stm32f2xx_usart.c | 2 +- hw/char/virtio-console.c | 2 +- hw/char/virtio-serial-bus.c | 4 ++-- hw/char/xilinx_uartlite.c | 2 +- hw/core/generic-loader.c | 2 +- hw/core/or-irq.c | 2 +- hw/core/platform-bus.c | 2 +- hw/core/qdev.c | 6 ++++++ hw/cpu/a15mpcore.c | 2 +- hw/cpu/a9mpcore.c | 2 +- hw/cpu/arm11mpcore.c | 2 +- hw/cpu/realview_mpcore.c | 2 +- hw/display/bcm2835_fb.c | 2 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 4 ++-- hw/display/g364fb.c | 2 +- hw/display/milkymist-vgafb.c | 2 +- hw/display/qxl.c | 2 +- hw/display/tcx.c | 2 +- hw/display/vga-isa.c | 2 +- hw/display/vga-pci.c | 4 ++-- hw/display/virtio-gpu-pci.c | 2 +- hw/display/virtio-gpu.c | 2 +- hw/display/virtio-vga.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/pxa2xx_dma.c | 2 +- hw/dma/sparc32_dma.c | 2 +- hw/dma/sun4m_iommu.c | 2 +- hw/dma/xilinx_axidma.c | 2 +- hw/gpio/imx_gpio.c | 2 +- hw/gpio/omap_gpio.c | 4 ++-- hw/i2c/core.c | 2 +- hw/i2c/omap_i2c.c | 2 +- hw/i2c/smbus_eeprom.c | 2 +- hw/i386/intel_iommu.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvm/ioapic.c | 2 +- hw/i386/kvm/pci-assign.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/cmd646.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/mmio.c | 2 +- hw/ide/qdev.c | 8 ++++---- hw/input/milkymist-softusb.c | 2 +- hw/input/virtio-input-hid.c | 2 +- hw/input/virtio-input-host.c | 2 +- hw/input/virtio-input.c | 2 +- hw/input/vmmouse.c | 2 +- hw/intc/apic_common.c | 2 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/arm_gicv2m.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/exynos4210_combiner.c | 2 +- hw/intc/exynos4210_gic.c | 4 ++-- hw/intc/grlib_irqmp.c | 2 +- hw/intc/i8259_common.c | 2 +- hw/intc/ioapic.c | 2 +- hw/intc/mips_gic.c | 2 +- hw/intc/omap_intc.c | 4 ++-- hw/intc/openpic.c | 2 +- hw/intc/openpic_kvm.c | 2 +- hw/intc/xilinx_intc.c | 2 +- hw/ipack/ipack.c | 2 +- hw/ipmi/ipmi.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/isa/pc87312.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/mips/cps.c | 2 +- hw/misc/a9scu.c | 2 +- hw/misc/applesmc.c | 2 +- hw/misc/arm11scu.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/arm_sysctl.c | 2 +- hw/misc/aspeed_scu.c | 2 +- hw/misc/aspeed_sdmc.c | 2 +- hw/misc/bcm2835_property.c | 2 +- hw/misc/debugexit.c | 2 +- hw/misc/eccmemctl.c | 2 +- hw/misc/ivshmem.c | 6 +++--- hw/misc/macio/cuda.c | 2 +- hw/misc/macio/macio.c | 2 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_cpc.c | 2 +- hw/misc/mips_itu.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000e.c | 3 ++- hw/net/eepro100.c | 2 +- hw/net/etraxfs_eth.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 2 +- hw/net/lance.c | 2 +- hw/net/milkymist-minimac2.c | 2 +- hw/net/mipsnet.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/net/ne2000.c | 2 +- hw/net/opencores_eth.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/spapr_llan.c | 2 +- hw/net/stellaris_enet.c | 2 +- hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 2 +- hw/net/xgmac.c | 2 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/nvram/ds1225y.c | 2 +- hw/nvram/fw_cfg.c | 4 ++-- hw/nvram/mac_nvram.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/pci-bridge/ioh3420.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 4 ++-- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-host/piix.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/prep.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci.c | 2 +- hw/pci/pcie_port.c | 4 ++-- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 2 +- hw/ppc/spapr_rng.c | 2 +- hw/ppc/spapr_vio.c | 2 +- hw/s390x/css-bridge.c | 2 +- hw/s390x/ipl.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/virtio-ccw.c | 18 +++++++++--------- hw/scsi/megasas.c | 2 +- hw/scsi/mptsas.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/scsi/scsi-disk.c | 8 ++++---- hw/scsi/scsi-generic.c | 2 +- hw/scsi/spapr_vscsi.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/sd/sd.c | 2 +- hw/sd/sdhci.c | 4 ++-- hw/sparc/sun4m.c | 4 ++-- hw/sparc64/sun4u.c | 4 ++-- hw/ssi/aspeed_smc.c | 2 +- hw/ssi/xilinx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- hw/timer/a9gtimer.c | 2 +- hw/timer/allwinner-a10-pit.c | 2 +- hw/timer/arm_mptimer.c | 2 +- hw/timer/arm_timer.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/i8254.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/m48t59.c | 4 ++-- hw/timer/mc146818rtc.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/pxa2xx_timer.c | 4 ++-- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/xilinx_timer.c | 2 +- hw/tpm/tpm_tis.c | 2 +- hw/usb/bus.c | 2 +- hw/usb/ccid-card-emulated.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-audio.c | 2 +- hw/usb/dev-hid.c | 6 +++--- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 4 ++-- hw/usb/dev-smartcard-reader.c | 4 ++-- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ohci.c | 4 ++-- hw/usb/hcd-uhci.c | 4 ++-- hw/usb/hcd-xhci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/pci.c | 2 +- hw/vfio/platform.c | 2 +- hw/virtio/vhost-vsock.c | 2 +- hw/virtio/virtio-balloon.c | 2 +- hw/virtio/virtio-mmio.c | 2 +- hw/virtio/virtio-pci.c | 20 ++++++++++---------- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- hw/xen/xen_backend.c | 2 +- hw/xen/xen_pt.c | 2 +- include/hw/qdev-core.h | 6 ++++++ target-arm/cpu.c | 2 +- target-i386/cpu.c | 4 ++-- target-microblaze/cpu.c | 2 +- target-ppc/translate_init.c | 6 +++--- tests/test-qdev-global-props.c | 2 +- 263 files changed, 329 insertions(+), 316 deletions(-)
hw/9pfs/virtio-9p-device.c +1 -1
@@ -207,7 +207,7 @@ static void virtio_9p_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_9p_properties; +device_class_set_props (dc, virtio_9p_properties); dc->vmsd = &vmstate_virtio_9p;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = virtio_9p_device_realize;
hw/acpi/piix4.c +1 -1
@@ -687,7 +687,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_BRIDGE_OTHER ; dc->desc ="PM" ; dc->vmsd = &vmstate_acpi; - dc->props = piix4_pm_properties; +device_class_set_props (dc, piix4_pm_properties);/* * Reason: part of PIIX4 southbridge, needs to be wired up, * e.g. by mips_malta_init()
hw/arm/armv7m.c +1 -1
@@ -245,7 +245,7 @@ static void bitband_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = bitband_properties; +device_class_set_props (dc, bitband_properties); }static const TypeInfo bitband_info = {
hw/arm/bcm2836.c +1 -1
@@ -158,7 +158,7 @@ static void bcm2836_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = bcm2836_props; +device_class_set_props (dc, bcm2836_props); dc->realize = bcm2836_realize;/*
hw/arm/integratorcp.c +1 -1
@@ -638,7 +638,7 @@ static void core_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = core_properties; +device_class_set_props (dc, core_properties); dc->realize = integratorcm_realize; }
hw/arm/musicpal.c +1 -1
@@ -431,7 +431,7 @@ static void mv88w8618_eth_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &mv88w8618_eth_vmsd; - dc->props = mv88w8618_eth_properties; +device_class_set_props (dc, mv88w8618_eth_properties); dc->realize = mv88w8618_eth_realize; }
hw/arm/pxa2xx.c +2 -2
@@ -1530,7 +1530,7 @@ static void pxa2xx_i2c_class_init(ObjectClass *klass, void *data) dc->desc ="PXA2xx I2C Bus Controller" ; dc->vmsd = &vmstate_pxa2xx_i2c; - dc->props = pxa2xx_i2c_properties; +device_class_set_props (dc, pxa2xx_i2c_properties); }static const TypeInfo pxa2xx_i2c_info = {
@@ -2013,7 +2013,7 @@ static void pxa2xx_fir_class_init(ObjectClass *klass, void *data) dc->realize = pxa2xx_fir_realize; dc->vmsd = &pxa2xx_fir_vmsd; - dc->props = pxa2xx_fir_properties; +device_class_set_props (dc, pxa2xx_fir_properties); dc->reset = pxa2xx_fir_reset; }
hw/arm/pxa2xx_gpio.c +1 -1
@@ -343,7 +343,7 @@ static void pxa2xx_gpio_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->desc ="PXA2xx GPIO controller" ; - dc->props = pxa2xx_gpio_properties; +device_class_set_props (dc, pxa2xx_gpio_properties); dc->vmsd = &vmstate_pxa2xx_gpio_regs; dc->realize = pxa2xx_gpio_realize; }
hw/arm/spitz.c +1 -1
@@ -1060,7 +1060,7 @@ static void sl_nand_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_sl_nand_info; - dc->props = sl_nand_properties; +device_class_set_props (dc, sl_nand_properties);/* Reason: init() method uses drive_get() */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/arm/stm32f205_soc.c +1 -1
@@ -202,7 +202,7 @@ static void stm32f205_soc_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = stm32f205_soc_realize; - dc->props = stm32f205_soc_properties; +device_class_set_props (dc, stm32f205_soc_properties); }static const TypeInfo stm32f205_soc_info = {
hw/arm/strongarm.c +1 -1
@@ -1320,7 +1320,7 @@ static void strongarm_uart_class_init(ObjectClass *klass, void *data) dc->desc ="StrongARM UART controller" ; dc->reset = strongarm_uart_reset; dc->vmsd = &vmstate_strongarm_uart_regs; - dc->props = strongarm_uart_properties; +device_class_set_props (dc, strongarm_uart_properties); dc->realize = strongarm_uart_realize; }
hw/arm/xlnx-zynqmp.c +1 -1
@@ -435,7 +435,7 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = xlnx_zynqmp_props; +device_class_set_props (dc, xlnx_zynqmp_props); dc->realize = xlnx_zynqmp_realize;/*
hw/audio/ac97.c +1 -1
@@ -1411,7 +1411,7 @@ static void ac97_class_init (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Intel 82801AA AC97 Audio" ; dc->vmsd = &vmstate_ac97; - dc->props = ac97_properties; +device_class_set_props (dc, ac97_properties); dc->reset = ac97_on_reset; }
hw/audio/adlib.c +1 -1
@@ -361,7 +361,7 @@ static void adlib_class_initfn (ObjectClass *klass, void *data) dc->realize = adlib_realizefn;set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc =ADLIB_DESC ; - dc->props = adlib_properties; +device_class_set_props (dc, adlib_properties); }static const TypeInfo adlib_info = {
hw/audio/cs4231.c +1 -1
@@ -166,7 +166,7 @@ static void cs4231_class_init(ObjectClass *klass, void *data) dc->reset = cs_reset; dc->vmsd = &vmstate_cs4231; - dc->props = cs4231_properties; +device_class_set_props (dc, cs4231_properties); }static const TypeInfo cs4231_info = {
hw/audio/cs4231a.c +1 -1
@@ -695,7 +695,7 @@ static void cs4231a_class_initfn (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Crystal Semiconductor CS4231A" ; dc->vmsd = &vmstate_cs4231a; - dc->props = cs4231a_properties; +device_class_set_props (dc, cs4231a_properties); }static const TypeInfo cs4231a_info = {
hw/audio/gus.c +1 -1
@@ -305,7 +305,7 @@ static void gus_class_initfn (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Gravis Ultrasound GF1" ; dc->vmsd = &vmstate_gus; - dc->props = gus_properties; +device_class_set_props (dc, gus_properties); }static const TypeInfo gus_info = {
hw/audio/hda-codec.c +1 -1
@@ -663,7 +663,7 @@ static void hda_audio_base_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->reset = hda_audio_reset; dc->vmsd = &vmstate_hda_audio; - dc->props = hda_audio_properties; +device_class_set_props (dc, hda_audio_properties); }static const TypeInfo hda_audio_info = {
hw/audio/intel-hda.c +2 -2
@@ -1269,7 +1269,7 @@ static void intel_hda_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_MULTIMEDIA_HD_AUDIO ; dc->reset = intel_hda_reset; dc->vmsd = &vmstate_intel_hda; - dc->props = intel_hda_properties; +device_class_set_props (dc, intel_hda_properties); }static void intel_hda_class_init_ich6 (ObjectClass *klass,void *data)
@@ -1321,7 +1321,7 @@ static void hda_codec_device_class_init(ObjectClass *klass, void *data) k->exit = hda_codec_dev_exit;set_bit (DEVICE_CATEGORY_SOUND , k->categories); k->bus_type =TYPE_HDA_BUS ; - k->props = hda_props; +device_class_set_props (k, hda_props); }static const TypeInfo hda_codec_device_type_info = {
hw/audio/marvell_88w8618.c +1 -1
@@ -287,7 +287,7 @@ static void mv88w8618_audio_class_init(ObjectClass *klass, void *data) k->init = mv88w8618_audio_init; dc->reset = mv88w8618_audio_reset; dc->vmsd = &mv88w8618_audio_vmsd; - dc->props = mv88w8618_audio_properties; +device_class_set_props (dc, mv88w8618_audio_properties);/* Reason: pointer property "wm8750" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/audio/pcspk.c +1 -1
@@ -211,7 +211,7 @@ static void pcspk_class_initfn(ObjectClass *klass, void *data) dc->realize = pcspk_realizefn;set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->vmsd = &vmstate_spk; - dc->props = pcspk_properties; +device_class_set_props (dc, pcspk_properties);/* Reason: realize sets global pcspk_state */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/audio/pl041.c +1 -1
@@ -633,7 +633,7 @@ static void pl041_device_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->reset = pl041_device_reset; dc->vmsd = &vmstate_pl041; - dc->props = pl041_device_properties; +device_class_set_props (dc, pl041_device_properties); }static const TypeInfo pl041_device_info = {
hw/audio/sb16.c +1 -1
@@ -1418,7 +1418,7 @@ static void sb16_class_initfn (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Creative Sound Blaster 16" ; dc->vmsd = &vmstate_sb16; - dc->props = sb16_properties; +device_class_set_props (dc, sb16_properties); }static const TypeInfo sb16_info = {
hw/block/fdc.c +4 -4
@@ -587,7 +587,7 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data) k->init = floppy_drive_init;set_bit (DEVICE_CATEGORY_STORAGE , k->categories); k->bus_type =TYPE_FLOPPY_BUS ; - k->props = floppy_drive_properties; +device_class_set_props (k, floppy_drive_properties); k->desc ="virtual floppy drive" ; }
@@ -2803,7 +2803,7 @@ static void isabus_fdc_class_init(ObjectClass *klass, void *data) dc->fw_name ="fdc" ; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; - dc->props = isa_fdc_properties; +device_class_set_props (dc, isa_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
@@ -2856,7 +2856,7 @@ static void sysbus_fdc_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = sysbus_fdc_properties; +device_class_set_props (dc, sysbus_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
@@ -2882,7 +2882,7 @@ static void sun4m_fdc_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = sun4m_fdc_properties; +device_class_set_props (dc, sun4m_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/block/m25p80.c +1 -1
@@ -1228,7 +1228,7 @@ static void m25p80_class_init(ObjectClass *klass, void *data) k->set_cs = m25p80_cs; k->cs_polarity =SSI_CS_LOW ; dc->vmsd = &vmstate_m25p80; - dc->props = m25p80_properties; +device_class_set_props (dc, m25p80_properties); dc->reset = m25p80_reset; mc->pi = data; }
hw/block/nand.c +1 -1
@@ -437,7 +437,7 @@ static void nand_class_init(ObjectClass *klass, void *data) dc->realize = nand_realize; dc->reset = nand_reset; dc->vmsd = &vmstate_nand; - dc->props = nand_properties; +device_class_set_props (dc, nand_properties); }static const TypeInfo nand_info = {
hw/block/nvme.c +1 -1
@@ -961,7 +961,7 @@ static void nvme_class_init(ObjectClass *oc, void *data)set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->desc ="Non-Volatile Memory Express" ; - dc->props = nvme_props; +device_class_set_props (dc, nvme_props); dc->vmsd = &nvme_vmstate; }
hw/block/onenand.c +1 -1
@@ -838,7 +838,7 @@ static void onenand_class_init(ObjectClass *klass, void *data) k->init = onenand_initfn; dc->reset = onenand_system_reset; - dc->props = onenand_properties; +device_class_set_props (dc, onenand_properties); }static const TypeInfo onenand_info = {
hw/block/pflash_cfi01.c +1 -1
@@ -893,7 +893,7 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pflash_cfi01_realize; - dc->props = pflash_cfi01_properties; +device_class_set_props (dc, pflash_cfi01_properties); dc->vmsd = &vmstate_pflash;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/block/pflash_cfi02.c +1 -1
@@ -744,7 +744,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pflash_cfi02_realize; - dc->props = pflash_cfi02_properties; +device_class_set_props (dc, pflash_cfi02_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/block/virtio-blk.c +1 -1
@@ -990,7 +990,7 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_blk_properties; +device_class_set_props (dc, virtio_blk_properties); dc->vmsd = &vmstate_virtio_blk;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = virtio_blk_device_realize;
hw/char/bcm2835_aux.c +1 -1
@@ -294,7 +294,7 @@ static void bcm2835_aux_class_init(ObjectClass *oc, void *data) dc->realize = bcm2835_aux_realize; dc->vmsd = &vmstate_bcm2835_aux;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); - dc->props = bcm2835_aux_props; +device_class_set_props (dc, bcm2835_aux_props); }static const TypeInfo bcm2835_aux_info = {
hw/char/cadence_uart.c +1 -1
@@ -522,7 +522,7 @@ static void cadence_uart_class_init(ObjectClass *klass, void *data) dc->realize = cadence_uart_realize; dc->vmsd = &vmstate_cadence_uart; dc->reset = cadence_uart_reset; - dc->props = cadence_uart_properties; +device_class_set_props (dc, cadence_uart_properties); }static const TypeInfo cadence_uart_info = {
hw/char/debugcon.c +1 -1
@@ -125,7 +125,7 @@ static void debugcon_isa_class_initfn(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = debugcon_isa_realizefn; - dc->props = debugcon_isa_properties; +device_class_set_props (dc, debugcon_isa_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/char/digic-uart.c +1 -1
@@ -181,7 +181,7 @@ static void digic_uart_class_init(ObjectClass *klass, void *data) dc->realize = digic_uart_realize; dc->reset = digic_uart_reset; dc->vmsd = &vmstate_digic_uart; - dc->props = digic_uart_properties; +device_class_set_props (dc, digic_uart_properties); }static const TypeInfo digic_uart_info = {
hw/char/escc.c +1 -1
@@ -1048,7 +1048,7 @@ static void escc_class_init(ObjectClass *klass, void *data) dc->reset = escc_reset; dc->realize = escc_realize; dc->vmsd = &vmstate_escc; - dc->props = escc_properties; +device_class_set_props (dc, escc_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
hw/char/etraxfs_ser.c +1 -1
@@ -241,7 +241,7 @@ static void etraxfs_ser_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = etraxfs_ser_reset; - dc->props = etraxfs_ser_properties; +device_class_set_props (dc, etraxfs_ser_properties); dc->realize = etraxfs_ser_realize; }
hw/char/exynos4210_uart.c +1 -1
@@ -662,7 +662,7 @@ static void exynos4210_uart_class_init(ObjectClass *klass, void *data) k->init = exynos4210_uart_init; dc->reset = exynos4210_uart_reset; - dc->props = exynos4210_uart_properties; +device_class_set_props (dc, exynos4210_uart_properties); dc->vmsd = &vmstate_exynos4210_uart; }
hw/char/grlib_apbuart.c +1 -1
@@ -284,7 +284,7 @@ static void grlib_apbuart_class_init(ObjectClass *klass, void *data) k->init = grlib_apbuart_init; dc->reset = grlib_apbuart_reset; - dc->props = grlib_apbuart_properties; +device_class_set_props (dc, grlib_apbuart_properties); }static const TypeInfo grlib_apbuart_info = {
hw/char/imx_serial.c +1 -1
@@ -344,7 +344,7 @@ static void imx_serial_class_init(ObjectClass *klass, void *data) dc->reset = imx_serial_reset_at_boot;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="i.MX series UART" ; - dc->props = imx_serial_properties; +device_class_set_props (dc, imx_serial_properties); }static const TypeInfo imx_serial_info = {
hw/char/ipoctal232.c +1 -1
@@ -584,7 +584,7 @@ static void ipoctal_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="GE IP-Octal 232 8-channel RS-232 IndustryPack" ; - dc->props = ipoctal_properties; +device_class_set_props (dc, ipoctal_properties); dc->vmsd = &vmstate_ipoctal; }
hw/char/lm32_juart.c +1 -1
@@ -144,7 +144,7 @@ static void lm32_juart_class_init(ObjectClass *klass, void *data) dc->reset = juart_reset; dc->vmsd = &vmstate_lm32_juart; - dc->props = lm32_juart_properties; +device_class_set_props (dc, lm32_juart_properties); dc->realize = lm32_juart_realize; }
hw/char/lm32_uart.c +1 -1
@@ -290,7 +290,7 @@ static void lm32_uart_class_init(ObjectClass *klass, void *data) dc->reset = uart_reset; dc->vmsd = &vmstate_lm32_uart; - dc->props = lm32_uart_properties; +device_class_set_props (dc, lm32_uart_properties); dc->realize = lm32_uart_realize; }
hw/char/milkymist-uart.c +1 -1
@@ -236,7 +236,7 @@ static void milkymist_uart_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_uart_realize; dc->reset = milkymist_uart_reset; dc->vmsd = &vmstate_milkymist_uart; - dc->props = milkymist_uart_properties; +device_class_set_props (dc, milkymist_uart_properties); }static const TypeInfo milkymist_uart_info = {
hw/char/parallel.c +1 -1
@@ -633,7 +633,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = parallel_isa_realizefn; dc->vmsd = &vmstate_parallel_isa; - dc->props = parallel_isa_properties; +device_class_set_props (dc, parallel_isa_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
hw/char/pl011.c +1 -1
@@ -338,7 +338,7 @@ static void pl011_class_init(ObjectClass *oc, void *data) dc->realize = pl011_realize; dc->vmsd = &vmstate_pl011; - dc->props = pl011_properties; +device_class_set_props (dc, pl011_properties); }static const TypeInfo pl011_arm_info = {
hw/char/sclpconsole-lm.c +1 -1
@@ -345,7 +345,7 @@ static void console_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);SCLPEventClass *ec =SCLP_EVENT_CLASS (klass); - dc->props = console_properties; +device_class_set_props (dc, console_properties); dc->reset = console_reset; dc->vmsd = &vmstate_sclplmconsole; ec->init = console_init;
hw/char/sclpconsole.c +1 -1
@@ -261,7 +261,7 @@ static void console_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);SCLPEventClass *ec =SCLP_EVENT_CLASS (klass); - dc->props = console_properties; +device_class_set_props (dc, console_properties); dc->reset = console_reset; dc->vmsd = &vmstate_sclpconsole; ec->init = console_init;
hw/char/serial-isa.c +1 -1
@@ -103,7 +103,7 @@ static void serial_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = serial_isa_realizefn; dc->vmsd = &vmstate_isa_serial; - dc->props = serial_isa_properties; +device_class_set_props (dc, serial_isa_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
hw/char/serial-pci.c +3 -3
@@ -211,7 +211,7 @@ static void serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision =1 ; pc->class_id =PCI_CLASS_COMMUNICATION_SERIAL ; dc->vmsd = &vmstate_pci_serial; - dc->props = serial_pci_properties; +device_class_set_props (dc, serial_pci_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
@@ -226,7 +226,7 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision =1 ; pc->class_id =PCI_CLASS_COMMUNICATION_SERIAL ; dc->vmsd = &vmstate_pci_multi_serial; - dc->props = multi_2x_serial_pci_properties; +device_class_set_props (dc, multi_2x_serial_pci_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
@@ -241,7 +241,7 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision =1 ; pc->class_id =PCI_CLASS_COMMUNICATION_SERIAL ; dc->vmsd = &vmstate_pci_multi_serial; - dc->props = multi_4x_serial_pci_properties; +device_class_set_props (dc, multi_4x_serial_pci_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
hw/char/spapr_vty.c +1 -1
@@ -171,7 +171,7 @@ static void spapr_vty_class_init(ObjectClass *klass, void *data) k->dt_type ="serial" ; k->dt_compatible ="hvterm1" ;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); - dc->props = spapr_vty_properties; +device_class_set_props (dc, spapr_vty_properties); dc->vmsd = &vmstate_spapr_vty; }
hw/char/stm32f2xx_usart.c +1 -1
@@ -215,7 +215,7 @@ static void stm32f2xx_usart_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = stm32f2xx_usart_reset; - dc->props = stm32f2xx_usart_properties; +device_class_set_props (dc, stm32f2xx_usart_properties); dc->realize = stm32f2xx_usart_realize; }
hw/char/virtio-console.c +1 -1
@@ -234,7 +234,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data) k->have_data = flush_buf; k->set_guest_connected = set_guest_connected; k->guest_writable = guest_writable; - dc->props = virtserialport_properties; +device_class_set_props (dc, virtserialport_properties); }static const TypeInfo virtserialport_info = {
hw/char/virtio-serial-bus.c +2 -2
@@ -1091,7 +1091,7 @@ static void virtio_serial_port_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_VIRTIO_SERIAL_BUS ; k->realize = virtser_port_device_realize; k->unrealize = virtser_port_device_unrealize; - k->props = virtser_props; +device_class_set_props (k, virtser_props); }static const TypeInfo virtio_serial_port_type_info = {
@@ -1149,7 +1149,7 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data)QLIST_INIT (&vserdevices.devices); - dc->props = virtio_serial_properties; +device_class_set_props (dc, virtio_serial_properties); dc->vmsd = &vmstate_virtio_console;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); vdc->realize = virtio_serial_device_realize;
hw/char/xilinx_uartlite.c +1 -1
@@ -232,7 +232,7 @@ static void xilinx_uartlite_class_init(ObjectClass *klass, void *data) dc->reset = xilinx_uartlite_reset; dc->realize = xilinx_uartlite_realize; - dc->props = xilinx_uartlite_properties; +device_class_set_props (dc, xilinx_uartlite_properties); }static const TypeInfo xilinx_uartlite_info = {
hw/core/generic-loader.c +1 -1
@@ -192,7 +192,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data)*/ dc->realize = generic_loader_realize; dc->unrealize = generic_loader_unrealize; - dc->props = generic_loader_props; +device_class_set_props (dc, generic_loader_props); dc->desc ="Generic Loader" ; }
hw/core/or-irq.c +1 -1
@@ -86,7 +86,7 @@ static void or_irq_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = or_irq_reset; - dc->props = or_irq_properties; +device_class_set_props (dc, or_irq_properties); dc->realize = or_irq_realize; dc->vmsd = &vmstate_or_irq; }
hw/core/platform-bus.c +1 -1
@@ -230,7 +230,7 @@ static void platform_bus_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = platform_bus_realize; - dc->props = platform_bus_properties; +device_class_set_props (dc, platform_bus_properties); }static const TypeInfo platform_bus_info = {
hw/core/qdev.c +6 -0
@@ -848,6 +848,12 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) }while (class !=object_class_by_name (TYPE_DEVICE )); } +void device_class_set_props (DeviceClass *dc,Property *props) +{ +assert (!dc->props); + dc->props = props; +} +static int qdev_add_hotpluggable_device (Object *obj,void *opaque) {GSList **list = opaque;
hw/cpu/a15mpcore.c +1 -1
@@ -138,7 +138,7 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = a15mp_priv_realize; - dc->props = a15mp_priv_properties; +device_class_set_props (dc, a15mp_priv_properties);/* We currently have no savable state */ }
hw/cpu/a9mpcore.c +1 -1
@@ -174,7 +174,7 @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = a9mp_priv_realize; - dc->props = a9mp_priv_properties; +device_class_set_props (dc, a9mp_priv_properties); }static const TypeInfo a9mp_priv_info = {
hw/cpu/arm11mpcore.c +1 -1
@@ -155,7 +155,7 @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = mpcore_priv_realize; - dc->props = mpcore_priv_properties; +device_class_set_props (dc, mpcore_priv_properties); }static const TypeInfo mpcore_priv_info = {
hw/cpu/realview_mpcore.c +1 -1
@@ -122,7 +122,7 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = realview_mpcore_realize; - dc->props = mpcore_rirq_properties; +device_class_set_props (dc, mpcore_rirq_properties); }static const TypeInfo mpcore_rirq_info = {
hw/display/bcm2835_fb.c +1 -1
@@ -404,7 +404,7 @@ static void bcm2835_fb_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = bcm2835_fb_props; +device_class_set_props (dc, bcm2835_fb_props); dc->realize = bcm2835_fb_realize; dc->reset = bcm2835_fb_reset; dc->vmsd = &vmstate_bcm2835_fb;
hw/display/cg3.c +1 -1
@@ -382,7 +382,7 @@ static void cg3_class_init(ObjectClass *klass, void *data) dc->realize = cg3_realizefn; dc->reset = cg3_reset; dc->vmsd = &vmstate_cg3; - dc->props = cg3_properties; +device_class_set_props (dc, cg3_properties); }static const TypeInfo cg3_info = {
hw/display/cirrus_vga.c +2 -2
@@ -2995,7 +2995,7 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_cirrus_vga; dc->realize = isa_cirrus_vga_realizefn; - dc->props = isa_cirrus_vga_properties; +device_class_set_props (dc, isa_cirrus_vga_properties);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); }
@@ -3071,7 +3071,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); dc->desc ="Cirrus CLGD 54xx VGA" ; dc->vmsd = &vmstate_pci_cirrus_vga; - dc->props = pci_vga_cirrus_properties; +device_class_set_props (dc, pci_vga_cirrus_properties); dc->hotpluggable = false; }
hw/display/g364fb.c +1 -1
@@ -541,7 +541,7 @@ static void g364fb_sysbus_class_init(ObjectClass *klass, void *data) dc->desc ="G364 framebuffer" ; dc->reset = g364fb_sysbus_reset; dc->vmsd = &vmstate_g364fb; - dc->props = g364fb_sysbus_properties; +device_class_set_props (dc, g364fb_sysbus_properties); }static const TypeInfo g364fb_sysbus_info = {
hw/display/milkymist-vgafb.c +1 -1
@@ -338,7 +338,7 @@ static void milkymist_vgafb_class_init(ObjectClass *klass, void *data) dc->reset = milkymist_vgafb_reset; dc->vmsd = &vmstate_milkymist_vgafb; - dc->props = milkymist_vgafb_properties; +device_class_set_props (dc, milkymist_vgafb_properties); dc->realize = milkymist_vgafb_realize; }
hw/display/qxl.c +1 -1
@@ -2339,7 +2339,7 @@ static void qxl_pci_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); dc->reset = qxl_reset_handler; dc->vmsd = &qxl_vmstate; - dc->props = qxl_properties; +device_class_set_props (dc, qxl_properties); }static const TypeInfo qxl_pci_type_info = {
hw/display/tcx.c +1 -1
@@ -1087,7 +1087,7 @@ static void tcx_class_init(ObjectClass *klass, void *data) dc->realize = tcx_realizefn; dc->reset = tcx_reset; dc->vmsd = &vmstate_tcx; - dc->props = tcx_properties; +device_class_set_props (dc, tcx_properties); }static const TypeInfo tcx_info = {
hw/display/vga-isa.c +1 -1
@@ -91,7 +91,7 @@ static void vga_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = vga_isa_realizefn; dc->reset = vga_isa_reset; dc->vmsd = &vmstate_vga_common; - dc->props = vga_isa_properties; +device_class_set_props (dc, vga_isa_properties);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); }
hw/display/vga-pci.c +2 -2
@@ -348,7 +348,7 @@ static void vga_class_init(ObjectClass *klass, void *data) k->realize = pci_std_vga_realize; k->romfile ="vgabios-stdvga.bin" ; k->class_id =PCI_CLASS_DISPLAY_VGA ; - dc->props = vga_pci_properties; +device_class_set_props (dc, vga_pci_properties); dc->hotpluggable = false; }
@@ -359,7 +359,7 @@ static void secondary_class_init(ObjectClass *klass, void *data) k->realize = pci_secondary_vga_realize; k->class_id =PCI_CLASS_DISPLAY_OTHER ; - dc->props = secondary_pci_properties; +device_class_set_props (dc, secondary_pci_properties); dc->reset = pci_secondary_vga_reset; }
hw/display/virtio-gpu-pci.c +1 -1
@@ -47,7 +47,7 @@ static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); - dc->props = virtio_gpu_pci_properties; +device_class_set_props (dc, virtio_gpu_pci_properties); dc->hotpluggable = false; k->realize = virtio_gpu_pci_realize; pcidev_k->class_id =PCI_CLASS_DISPLAY_OTHER ;
hw/display/virtio-gpu.c +1 -1
@@ -1263,7 +1263,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data) vdc->reset = virtio_gpu_reset; - dc->props = virtio_gpu_properties; +device_class_set_props (dc, virtio_gpu_properties); dc->vmsd = &vmstate_virtio_gpu; }
hw/display/virtio-vga.c +1 -1
@@ -186,7 +186,7 @@ static void virtio_vga_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); - dc->props = virtio_vga_properties; +device_class_set_props (dc, virtio_vga_properties); dc->reset = virtio_vga_reset; dc->vmsd = &vmstate_virtio_vga; dc->hotpluggable = false;
hw/display/vmware_vga.c +1 -1
@@ -1356,7 +1356,7 @@ static void vmsvga_class_init(ObjectClass *klass, void *data) k->subsystem_id =SVGA_PCI_DEVICE_ID ; dc->reset = vmsvga_reset; dc->vmsd = &vmstate_vmware_vga; - dc->props = vga_vmware_properties; +device_class_set_props (dc, vga_vmware_properties); dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); }
hw/dma/i82374.c +1 -1
@@ -138,7 +138,7 @@ static void i82374_class_init(ObjectClass *klass, void *data) dc->realize = i82374_realize; dc->vmsd = &vmstate_i82374; - dc->props = i82374_properties; +device_class_set_props (dc, i82374_properties); }static const TypeInfo i82374_info = {
hw/dma/i8257.c +1 -1
@@ -590,7 +590,7 @@ static void i8257_class_init(ObjectClass *klass, void *data) dc->realize = i8257_realize; dc->reset = i8257_reset; dc->vmsd = &vmstate_i8257; - dc->props = i8257_properties; +device_class_set_props (dc, i8257_properties); idc->get_transfer_mode = i8257_dma_get_transfer_mode; idc->has_autoinitialization = i8257_dma_has_autoinitialization;
hw/dma/pl330.c +1 -1
@@ -1650,7 +1650,7 @@ static void pl330_class_init(ObjectClass *klass, void *data) dc->realize = pl330_realize; dc->reset = pl330_reset; - dc->props = pl330_properties; +device_class_set_props (dc, pl330_properties); dc->vmsd = &vmstate_pl330; }
hw/dma/pxa2xx_dma.c +1 -1
@@ -562,7 +562,7 @@ static void pxa2xx_dma_class_init(ObjectClass *klass, void *data) dc->desc ="PXA2xx DMA controller" ; dc->vmsd = &vmstate_pxa2xx_dma; - dc->props = pxa2xx_dma_properties; +device_class_set_props (dc, pxa2xx_dma_properties); dc->realize = pxa2xx_dma_realize; }
hw/dma/sparc32_dma.c +1 -1
@@ -303,7 +303,7 @@ static void sparc32_dma_class_init(ObjectClass *klass, void *data) k->init = sparc32_dma_init1; dc->reset = dma_reset; dc->vmsd = &vmstate_dma; - dc->props = sparc32_dma_properties; +device_class_set_props (dc, sparc32_dma_properties);/* Reason: pointer property "iommu_opaque" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/dma/sun4m_iommu.c +1 -1
@@ -375,7 +375,7 @@ static void iommu_class_init(ObjectClass *klass, void *data) k->init = iommu_init1; dc->reset = iommu_reset; dc->vmsd = &vmstate_iommu; - dc->props = iommu_properties; +device_class_set_props (dc, iommu_properties); }static const TypeInfo iommu_info = {
hw/dma/xilinx_axidma.c +1 -1
@@ -604,7 +604,7 @@ static void axidma_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_axidma_realize, dc->reset = xilinx_axidma_reset; - dc->props = axidma_properties; +device_class_set_props (dc, axidma_properties); }static StreamSlaveClass xilinx_axidma_data_stream_class = {
hw/gpio/imx_gpio.c +1 -1
@@ -331,7 +331,7 @@ static void imx_gpio_class_init(ObjectClass *klass, void *data) dc->realize = imx_gpio_realize; dc->reset = imx_gpio_reset; - dc->props = imx_gpio_properties; +device_class_set_props (dc, imx_gpio_properties); dc->vmsd = &vmstate_imx_gpio; dc->desc ="i.MX GPIO controller" ; }
hw/gpio/omap_gpio.c +2 -2
@@ -771,7 +771,7 @@ static void omap_gpio_class_init(ObjectClass *klass, void *data) dc->realize = omap_gpio_realize; dc->reset = omap_gpif_reset; - dc->props = omap_gpio_properties; +device_class_set_props (dc, omap_gpio_properties);/* Reason: pointer property "clk" */ dc->cannot_instantiate_with_device_add_yet = true; }
@@ -802,7 +802,7 @@ static void omap2_gpio_class_init(ObjectClass *klass, void *data) dc->realize = omap2_gpio_realize; dc->reset = omap2_gpif_reset; - dc->props = omap2_gpio_properties; +device_class_set_props (dc, omap2_gpio_properties);/* Reason: pointer properties "iclk", "fclk0", ..., "fclk5" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/i2c/core.c +1 -1
@@ -279,7 +279,7 @@ static void i2c_slave_class_init(ObjectClass *klass, void *data) k->init = i2c_slave_qdev_init;set_bit (DEVICE_CATEGORY_MISC , k->categories); k->bus_type =TYPE_I2C_BUS ; - k->props = i2c_props; +device_class_set_props (k, i2c_props); }static const TypeInfo i2c_slave_type_info = {
hw/i2c/omap_i2c.c +1 -1
@@ -488,7 +488,7 @@ static void omap_i2c_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = omap_i2c_properties; +device_class_set_props (dc, omap_i2c_properties); dc->reset = omap_i2c_reset;/* Reason: pointer properties "iclk", "fclk" */ dc->cannot_instantiate_with_device_add_yet = true;
hw/i2c/smbus_eeprom.c +1 -1
@@ -121,7 +121,7 @@ static void smbus_eeprom_class_initfn(ObjectClass *klass, void *data) sc->receive_byte = eeprom_receive_byte; sc->write_data = eeprom_write_data; sc->read_data = eeprom_read_data; - dc->props = smbus_eeprom_properties; +device_class_set_props (dc, smbus_eeprom_properties);/* Reason: pointer property "data" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/i386/intel_iommu.c +1 -1
@@ -2542,7 +2542,7 @@ static void vtd_class_init(ObjectClass *klass, void *data) dc->reset = vtd_reset; dc->vmsd = &vtd_vmstate; - dc->props = vtd_properties; +device_class_set_props (dc, vtd_properties); dc->hotpluggable = false; x86_class->realize = vtd_realize; x86_class->int_remap = vtd_int_remap;
hw/i386/kvm/i8254.c +1 -1
@@ -320,7 +320,7 @@ static void kvm_pit_class_init(ObjectClass *klass, void *data) k->set_channel_gate = kvm_pit_set_gate; k->get_channel_info = kvm_pit_get_channel_info; dc->reset = kvm_pit_reset; - dc->props = kvm_pit_properties; +device_class_set_props (dc, kvm_pit_properties); }static const TypeInfo kvm_pit_info = {
hw/i386/kvm/ioapic.c +1 -1
@@ -161,7 +161,7 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data) k->pre_save = kvm_ioapic_get; k->post_load = kvm_ioapic_put; dc->reset = kvm_ioapic_reset; - dc->props = kvm_ioapic_properties; +device_class_set_props (dc, kvm_ioapic_properties); }static const TypeInfo kvm_ioapic_info = {
hw/i386/kvm/pci-assign.c +1 -1
@@ -1861,7 +1861,7 @@ static void assign_class_init(ObjectClass *klass, void *data) k->exit = assigned_exitfn; k->config_read = assigned_dev_pci_read_config; k->config_write = assigned_dev_pci_write_config; - dc->props = assigned_dev_properties; +device_class_set_props (dc, assigned_dev_properties); dc->vmsd = &vmstate_assigned_device; dc->reset = reset_assigned_device;set_bit (DEVICE_CATEGORY_MISC , dc->categories);
hw/i386/xen/xen_pvdevice.c +1 -1
@@ -119,7 +119,7 @@ static void xen_pv_class_init(ObjectClass *klass, void *data) k->realize = xen_pv_realize; k->class_id =PCI_CLASS_SYSTEM_OTHER ; dc->desc ="Xen PV Device" ; - dc->props = xen_pv_props; +device_class_set_props (dc, xen_pv_props); }static const TypeInfo xen_pv_type_info = {
hw/ide/ahci.c +1 -1
@@ -1706,7 +1706,7 @@ static void sysbus_ahci_class_init(ObjectClass *klass, void *data) dc->realize = sysbus_ahci_realize; dc->vmsd = &vmstate_sysbus_ahci; - dc->props = sysbus_ahci_properties; +device_class_set_props (dc, sysbus_ahci_properties); dc->reset = sysbus_ahci_reset;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/ide/cmd646.c +1 -1
@@ -417,7 +417,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_STORAGE_IDE ; k->config_read = cmd646_pci_config_read; k->config_write = cmd646_pci_config_write; - dc->props = cmd646_ide_properties; +device_class_set_props (dc, cmd646_ide_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/ide/isa.c +1 -1
@@ -116,7 +116,7 @@ static void isa_ide_class_initfn(ObjectClass *klass, void *data) dc->realize = isa_ide_realizefn; dc->fw_name ="ide" ; dc->reset = isa_ide_reset; - dc->props = isa_ide_properties; +device_class_set_props (dc, isa_ide_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/ide/mmio.c +1 -1
@@ -152,7 +152,7 @@ static void mmio_ide_class_init(ObjectClass *oc, void *data) dc->realize = mmio_ide_realizefn; dc->reset = mmio_ide_reset; - dc->props = mmio_ide_properties; +device_class_set_props (dc, mmio_ide_properties); dc->vmsd = &vmstate_ide_mmio; }
hw/ide/qdev.c +4 -4
@@ -305,7 +305,7 @@ static void ide_hd_class_init(ObjectClass *klass, void *data) k->init = ide_hd_initfn; dc->fw_name ="drive" ; dc->desc ="virtual IDE disk" ; - dc->props = ide_hd_properties; +device_class_set_props (dc, ide_hd_properties); }static const TypeInfo ide_hd_info = {
@@ -327,7 +327,7 @@ static void ide_cd_class_init(ObjectClass *klass, void *data) k->init = ide_cd_initfn; dc->fw_name ="drive" ; dc->desc ="virtual IDE CD-ROM" ; - dc->props = ide_cd_properties; +device_class_set_props (dc, ide_cd_properties); }static const TypeInfo ide_cd_info = {
@@ -349,7 +349,7 @@ static void ide_drive_class_init(ObjectClass *klass, void *data) k->init = ide_drive_initfn; dc->fw_name ="drive" ; dc->desc ="virtual IDE disk or CD-ROM (legacy)" ; - dc->props = ide_drive_properties; +device_class_set_props (dc, ide_drive_properties); }static const TypeInfo ide_drive_info = {
@@ -366,7 +366,7 @@ static void ide_device_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_STORAGE , k->categories); k->bus_type =TYPE_IDE_BUS ; k->unrealize = idebus_unrealize; - k->props = ide_props; +device_class_set_props (k, ide_props); }static const TypeInfo ide_device_type_info = {
hw/input/milkymist-softusb.c +1 -1
@@ -301,7 +301,7 @@ static void milkymist_softusb_class_init(ObjectClass *klass, void *data) k->init = milkymist_softusb_init; dc->reset = milkymist_softusb_reset; dc->vmsd = &vmstate_milkymist_softusb; - dc->props = milkymist_softusb_properties; +device_class_set_props (dc, milkymist_softusb_properties); }static const TypeInfo milkymist_softusb_info = {
hw/input/virtio-input-hid.c +1 -1
@@ -327,7 +327,7 @@ static void virtio_input_hid_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtIOInputClass *vic =VIRTIO_INPUT_CLASS (klass); - dc->props = virtio_input_hid_properties; +device_class_set_props (dc, virtio_input_hid_properties); vic->realize = virtio_input_hid_realize; vic->unrealize = virtio_input_hid_unrealize; vic->change_active = virtio_input_hid_change_active;
hw/input/virtio-input-host.c +1 -1
@@ -226,7 +226,7 @@ static void virtio_input_host_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_virtio_input_host; - dc->props = virtio_input_host_properties; +device_class_set_props (dc, virtio_input_host_properties); vic->realize = virtio_input_host_realize; vic->unrealize = virtio_input_host_unrealize; vic->handle_status = virtio_input_host_handle_status;
hw/input/virtio-input.c +1 -1
@@ -310,7 +310,7 @@ static void virtio_input_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_input_properties; +device_class_set_props (dc, virtio_input_properties); dc->vmsd = &vmstate_virtio_input;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); vdc->realize = virtio_input_device_realize;
hw/input/vmmouse.c +1 -1
@@ -284,7 +284,7 @@ static void vmmouse_class_initfn(ObjectClass *klass, void *data) dc->realize = vmmouse_realizefn; dc->reset = vmmouse_reset; dc->vmsd = &vmstate_vmmouse; - dc->props = vmmouse_properties; +device_class_set_props (dc, vmmouse_properties);/* Reason: pointer property "ps2_mouse" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/intc/apic_common.c +1 -1
@@ -491,7 +491,7 @@ static void apic_common_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = apic_reset_common; - dc->props = apic_properties_common; +device_class_set_props (dc, apic_properties_common); dc->realize = apic_common_realize; dc->unrealize = apic_common_unrealize;/*
hw/intc/arm_gic_common.c +1 -1
@@ -264,7 +264,7 @@ static void arm_gic_common_class_init(ObjectClass *klass, void *data) dc->reset = arm_gic_common_reset; dc->realize = arm_gic_common_realize; - dc->props = arm_gic_common_properties; +device_class_set_props (dc, arm_gic_common_properties); dc->vmsd = &vmstate_gic; albifc->arm_linux_init = arm_gic_common_linux_init; }
hw/intc/arm_gicv2m.c +1 -1
@@ -176,7 +176,7 @@ static void gicv2m_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = gicv2m_properties; +device_class_set_props (dc, gicv2m_properties); dc->realize = gicv2m_realize; }
hw/intc/arm_gicv3_common.c +1 -1
@@ -325,7 +325,7 @@ static void arm_gicv3_common_class_init(ObjectClass *klass, void *data) dc->reset = arm_gicv3_common_reset; dc->realize = arm_gicv3_common_realize; - dc->props = arm_gicv3_common_properties; +device_class_set_props (dc, arm_gicv3_common_properties); dc->vmsd = &vmstate_gicv3; albifc->arm_linux_init = arm_gic_common_linux_init; }
hw/intc/etraxfs_pic.c +1 -1
@@ -170,7 +170,7 @@ static void etraxfs_pic_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = etraxfs_pic_properties; +device_class_set_props (dc, etraxfs_pic_properties);/* * Note: pointer property "interrupt_vector" may remain null, thus * no need for dc->cannot_instantiate_with_device_add_yet = true;
hw/intc/exynos4210_combiner.c +1 -1
@@ -437,7 +437,7 @@ static void exynos4210_combiner_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = exynos4210_combiner_reset; - dc->props = exynos4210_combiner_properties; +device_class_set_props (dc, exynos4210_combiner_properties); dc->vmsd = &vmstate_exynos4210_combiner; }
hw/intc/exynos4210_gic.c +2 -2
@@ -346,7 +346,7 @@ static void exynos4210_gic_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = exynos4210_gic_properties; +device_class_set_props (dc, exynos4210_gic_properties); }static const TypeInfo exynos4210_gic_info = {
@@ -453,7 +453,7 @@ static void exynos4210_irq_gate_class_init(ObjectClass *klass, void *data) dc->reset = exynos4210_irq_gate_reset; dc->vmsd = &vmstate_exynos4210_irq_gate; - dc->props = exynos4210_irq_gate_properties; +device_class_set_props (dc, exynos4210_irq_gate_properties); dc->realize = exynos4210_irq_gate_realize; }
hw/intc/grlib_irqmp.c +1 -1
@@ -358,7 +358,7 @@ static void grlib_irqmp_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = grlib_irqmp_reset; - dc->props = grlib_irqmp_properties; +device_class_set_props (dc, grlib_irqmp_properties);/* Reason: pointer properties "set_pil_in", "set_pil_in_opaque" */ dc->cannot_instantiate_with_device_add_yet = true; dc->realize = grlib_irqmp_realize;
hw/intc/i8259_common.c +1 -1
@@ -136,7 +136,7 @@ static void pic_common_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_pic_common; - dc->props = pic_properties_common; +device_class_set_props (dc, pic_properties_common); dc->realize = pic_common_realize;/* * Reason: unlike ordinary ISA devices, the PICs need additional
hw/intc/ioapic.c +1 -1
@@ -427,7 +427,7 @@ static void ioapic_class_init(ObjectClass *klass, void *data) k->realize = ioapic_realize; dc->reset = ioapic_reset_common; - dc->props = ioapic_properties; +device_class_set_props (dc, ioapic_properties); }static const TypeInfo ioapic_info = {
hw/intc/mips_gic.c +1 -1
@@ -440,7 +440,7 @@ static void mips_gic_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = mips_gic_properties; +device_class_set_props (dc, mips_gic_properties); dc->realize = mips_gic_realize; }
hw/intc/omap_intc.c +2 -2
@@ -399,7 +399,7 @@ static void omap_intc_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = omap_inth_reset; - dc->props = omap_intc_properties; +device_class_set_props (dc, omap_intc_properties);/* Reason: pointer property "clk" */ dc->cannot_instantiate_with_device_add_yet = true; dc->realize = omap_intc_realize;
@@ -654,7 +654,7 @@ static void omap2_intc_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = omap_inth_reset; - dc->props = omap2_intc_properties; +device_class_set_props (dc, omap2_intc_properties);/* Reason: pointer property "iclk", "fclk" */ dc->cannot_instantiate_with_device_add_yet = true; dc->realize = omap2_intc_realize;
hw/intc/openpic.c +1 -1
@@ -1643,7 +1643,7 @@ static void openpic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = openpic_realize; - dc->props = openpic_properties; +device_class_set_props (dc, openpic_properties); dc->reset = openpic_reset; dc->vmsd = &vmstate_openpic;set_bit (DEVICE_CATEGORY_MISC , dc->categories);
hw/intc/openpic_kvm.c +1 -1
@@ -277,7 +277,7 @@ static void kvm_openpic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = kvm_openpic_realize; - dc->props = kvm_openpic_properties; +device_class_set_props (dc, kvm_openpic_properties); dc->reset = kvm_openpic_reset;set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/intc/xilinx_intc.c +1 -1
@@ -183,7 +183,7 @@ static void xilinx_intc_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = xilinx_intc_properties; +device_class_set_props (dc, xilinx_intc_properties); }static const TypeInfo xilinx_intc_info = {
hw/ipack/ipack.c +1 -1
@@ -84,7 +84,7 @@ static void ipack_device_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_IPACK_BUS ; k->realize = ipack_device_realize; k->unrealize = ipack_device_unrealize; - k->props = ipack_device_props; +device_class_set_props (k, ipack_device_props); }const VMStateDescription vmstate_ipack_device = {
hw/ipmi/ipmi.c +1 -1
@@ -110,7 +110,7 @@ static void bmc_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = ipmi_bmc_properties; +device_class_set_props (dc, ipmi_bmc_properties); }static TypeInfo ipmi_bmc_type_info = {
hw/ipmi/ipmi_bmc_extern.c +1 -1
@@ -513,7 +513,7 @@ static void ipmi_bmc_extern_class_init(ObjectClass *oc, void *data) bk->handle_command = ipmi_bmc_extern_handle_command; bk->handle_reset = ipmi_bmc_extern_handle_reset; dc->realize = ipmi_bmc_extern_realize; - dc->props = ipmi_bmc_extern_properties; +device_class_set_props (dc, ipmi_bmc_extern_properties); }static const TypeInfo ipmi_bmc_extern_type = {
hw/ipmi/isa_ipmi_bt.c +1 -1
@@ -511,7 +511,7 @@ static void isa_ipmi_bt_class_init(ObjectClass *oc, void *data)IPMIInterfaceClass *iic =IPMI_INTERFACE_CLASS (oc); dc->realize = isa_ipmi_bt_realize; - dc->props = ipmi_isa_properties; +device_class_set_props (dc, ipmi_isa_properties); iic->get_backend_data = isa_ipmi_bt_get_backend_data;ipmi_bt_class_init (iic);
hw/ipmi/isa_ipmi_kcs.c +1 -1
@@ -475,7 +475,7 @@ static void isa_ipmi_kcs_class_init(ObjectClass *oc, void *data)IPMIInterfaceClass *iic =IPMI_INTERFACE_CLASS (oc); dc->realize = ipmi_isa_realize; - dc->props = ipmi_isa_properties; +device_class_set_props (dc, ipmi_isa_properties); iic->get_backend_data = isa_ipmi_kcs_get_backend_data;ipmi_kcs_class_init (iic);
hw/isa/lpc_ich9.c +1 -1
@@ -710,7 +710,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data) dc->reset = ich9_lpc_reset; k->realize = ich9_lpc_realize; dc->vmsd = &vmstate_ich9_lpc; - dc->props = ich9_lpc_properties; +device_class_set_props (dc, ich9_lpc_properties); k->config_write = ich9_lpc_config_write; dc->desc ="ICH9 LPC bridge" ; k->vendor_id =PCI_VENDOR_ID_INTEL ;
hw/isa/pc87312.c +1 -1
@@ -385,7 +385,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data) dc->realize = pc87312_realize; dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; - dc->props = pc87312_properties; +device_class_set_props (dc, pc87312_properties); }static const TypeInfo pc87312_type_info = {
hw/isa/vt82c686.c +1 -1
@@ -411,7 +411,7 @@ static void via_pm_class_init(ObjectClass *klass, void *data) dc->desc ="PM" ; dc->vmsd = &vmstate_acpi;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); - dc->props = via_pm_properties; +device_class_set_props (dc, via_pm_properties); }static const TypeInfo via_pm_info = {
hw/mem/pc-dimm.c +1 -1
@@ -443,7 +443,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data) dc->realize = pc_dimm_realize; dc->unrealize = pc_dimm_unrealize; - dc->props = pc_dimm_properties; +device_class_set_props (dc, pc_dimm_properties); dc->desc ="DIMM memory module" ; ddc->get_memory_region = pc_dimm_get_memory_region;
hw/mips/cps.c +1 -1
@@ -173,7 +173,7 @@ static void mips_cps_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = mips_cps_realize; - dc->props = mips_cps_properties; +device_class_set_props (dc, mips_cps_properties); }static const TypeInfo mips_cps_info = {
hw/misc/a9scu.c +1 -1
@@ -132,7 +132,7 @@ static void a9_scu_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = a9_scu_properties; +device_class_set_props (dc, a9_scu_properties); dc->vmsd = &vmstate_a9_scu; dc->reset = a9_scu_reset; }
hw/misc/applesmc.c +1 -1
@@ -261,7 +261,7 @@ static void qdev_applesmc_class_init(ObjectClass *klass, void *data) dc->realize = applesmc_isa_realize; dc->reset = qdev_applesmc_isa_reset; - dc->props = applesmc_isa_properties; +device_class_set_props (dc, applesmc_isa_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/misc/arm11scu.c +1 -1
@@ -83,7 +83,7 @@ static void arm11_scu_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = arm11_scu_realize; - dc->props = arm11_scu_properties; +device_class_set_props (dc, arm11_scu_properties); }static const TypeInfo arm11_scu_type_info = {
hw/misc/arm_l2x0.c +1 -1
@@ -179,7 +179,7 @@ static void l2x0_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_l2x0; - dc->props = l2x0_properties; +device_class_set_props (dc, l2x0_properties); dc->reset = l2x0_priv_reset; }
hw/misc/arm_sysctl.c +1 -1
@@ -639,7 +639,7 @@ static void arm_sysctl_class_init(ObjectClass *klass, void *data) dc->realize = arm_sysctl_realize; dc->reset = arm_sysctl_reset; dc->vmsd = &vmstate_arm_sysctl; - dc->props = arm_sysctl_properties; +device_class_set_props (dc, arm_sysctl_properties); }static const TypeInfo arm_sysctl_info = {
hw/misc/aspeed_scu.c +1 -1
@@ -307,7 +307,7 @@ static void aspeed_scu_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_scu_reset; dc->desc ="ASPEED System Control Unit" ; dc->vmsd = &vmstate_aspeed_scu; - dc->props = aspeed_scu_properties; +device_class_set_props (dc, aspeed_scu_properties); }static const TypeInfo aspeed_scu_info = {
hw/misc/aspeed_sdmc.c +1 -1
@@ -262,7 +262,7 @@ static void aspeed_sdmc_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_sdmc_reset; dc->desc ="ASPEED SDRAM Memory Controller" ; dc->vmsd = &vmstate_aspeed_sdmc; - dc->props = aspeed_sdmc_properties; +device_class_set_props (dc, aspeed_sdmc_properties); }static const TypeInfo aspeed_sdmc_info = {
hw/misc/bcm2835_property.c +1 -1
@@ -419,7 +419,7 @@ static void bcm2835_property_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = bcm2835_property_props; +device_class_set_props (dc, bcm2835_property_props); dc->realize = bcm2835_property_realize; dc->vmsd = &vmstate_bcm2835_property; }
hw/misc/debugexit.c +1 -1
@@ -58,7 +58,7 @@ static void debug_exit_class_initfn(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = debug_exit_realizefn; - dc->props = debug_exit_properties; +device_class_set_props (dc, debug_exit_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/misc/eccmemctl.c +1 -1
@@ -326,7 +326,7 @@ static void ecc_class_init(ObjectClass *klass, void *data) k->init = ecc_init1; dc->reset = ecc_reset; dc->vmsd = &vmstate_ecc; - dc->props = ecc_properties; +device_class_set_props (dc, ecc_properties); }static const TypeInfo ecc_info = {
hw/misc/ivshmem.c +3 -3
@@ -1074,7 +1074,7 @@ static void ivshmem_plain_class_init(ObjectClass *klass, void *data) k->realize = ivshmem_plain_realize; k->exit = ivshmem_plain_exit; - dc->props = ivshmem_plain_properties; +device_class_set_props (dc, ivshmem_plain_properties); dc->vmsd = &ivshmem_plain_vmsd; }
@@ -1136,7 +1136,7 @@ static void ivshmem_doorbell_class_init(ObjectClass *klass, void *data)PCIDeviceClass *k =PCI_DEVICE_CLASS (klass); k->realize = ivshmem_doorbell_realize; - dc->props = ivshmem_doorbell_properties; +device_class_set_props (dc, ivshmem_doorbell_properties); dc->vmsd = &ivshmem_doorbell_vmsd; }
@@ -1304,7 +1304,7 @@ static void ivshmem_class_init(ObjectClass *klass, void *data) k->realize = ivshmem_realize; k->revision =0 ; dc->desc ="Inter-VM shared memory (legacy)" ; - dc->props = ivshmem_properties; +device_class_set_props (dc, ivshmem_properties); dc->vmsd = &ivshmem_vmsd; }
hw/misc/macio/cuda.c +1 -1
@@ -945,7 +945,7 @@ static void cuda_class_init(ObjectClass *oc, void *data) dc->realize = cuda_realizefn; dc->reset = cuda_reset; dc->vmsd = &vmstate_cuda; - dc->props = cuda_properties; +device_class_set_props (dc, cuda_properties);set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }
hw/misc/macio/macio.c +1 -1
@@ -388,7 +388,7 @@ static void macio_class_init(ObjectClass *klass, void *data) k->vendor_id =PCI_VENDOR_ID_APPLE ; k->class_id =PCI_CLASS_OTHERS <<8 ; - dc->props = macio_properties; +device_class_set_props (dc, macio_properties);set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }
hw/misc/mips_cmgcr.c +1 -1
@@ -224,7 +224,7 @@ static void mips_gcr_realize(DeviceState *dev, Error **errp)static void mips_gcr_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = mips_gcr_properties; +device_class_set_props (dc, mips_gcr_properties); dc->vmsd = &vmstate_mips_gcr; dc->reset = mips_gcr_reset; dc->realize = mips_gcr_realize;
hw/misc/mips_cpc.c +1 -1
@@ -159,7 +159,7 @@ static void mips_cpc_class_init(ObjectClass *klass, void *data) dc->realize = mips_cpc_realize; dc->reset = mips_cpc_reset; dc->vmsd = &vmstate_mips_cpc; - dc->props = mips_cpc_properties; +device_class_set_props (dc, mips_cpc_properties); }static const TypeInfo mips_cpc_info = {
hw/misc/mips_itu.c +1 -1
@@ -503,7 +503,7 @@ static void mips_itu_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = mips_itu_properties; +device_class_set_props (dc, mips_itu_properties); dc->realize = mips_itu_realize; dc->reset = mips_itu_reset; }
hw/misc/pvpanic.c +1 -1
@@ -124,7 +124,7 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pvpanic_isa_realizefn; - dc->props = pvpanic_isa_properties; +device_class_set_props (dc, pvpanic_isa_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/net/allwinner_emac.c +1 -1
@@ -514,7 +514,7 @@ static void aw_emac_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = aw_emac_realize; - dc->props = aw_emac_properties; +device_class_set_props (dc, aw_emac_properties); dc->reset = aw_emac_reset; dc->vmsd = &vmstate_aw_emac; }
hw/net/cadence_gem.c +1 -1
@@ -1522,7 +1522,7 @@ static void gem_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = gem_realize; - dc->props = gem_properties; +device_class_set_props (dc, gem_properties); dc->vmsd = &vmstate_cadence_gem; dc->reset = gem_reset; }
hw/net/dp8393x.c +1 -1
@@ -891,7 +891,7 @@ static void dp8393x_class_init(ObjectClass *klass, void *data) dc->realize = dp8393x_realize; dc->reset = dp8393x_reset; dc->vmsd = &vmstate_dp8393x; - dc->props = dp8393x_properties; +device_class_set_props (dc, dp8393x_properties);/* Reason: dma_mr property can't be set */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/net/e1000.c +1 -1
@@ -1667,7 +1667,7 @@ static void e1000_class_init(ObjectClass *klass, void *data) dc->desc ="Intel Gigabit Ethernet" ; dc->reset = qdev_e1000_reset; dc->vmsd = &vmstate_e1000; - dc->props = e1000_properties; +device_class_set_props (dc, e1000_properties); }static void e1000_instance_init (Object *obj)
hw/net/e1000e.c +2 -1
@@ -671,7 +671,6 @@ static void e1000e_class_init(ObjectClass *class, void *data) dc->desc ="Intel 82574L GbE Controller" ; dc->reset = e1000e_qdev_reset; dc->vmsd = &e1000e_vmstate; - dc->props = e1000e_properties; e1000e_prop_disable_vnet = qdev_prop_uint8; e1000e_prop_disable_vnet.description ="Do not use virtio headers, "
@@ -684,6 +683,8 @@ static void e1000e_class_init(ObjectClass *class, void *data) e1000e_prop_subsys = qdev_prop_uint16; e1000e_prop_subsys.description ="PCI device Subsystem ID" ; +device_class_set_props (dc, e1000e_properties); +set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
hw/net/eepro100.c +1 -1
@@ -2082,7 +2082,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data) info =eepro100_get_class_by_name (object_class_get_name (klass));set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); - dc->props = e100_properties; +device_class_set_props (dc, e100_properties); dc->desc = info->desc; k->vendor_id =PCI_VENDOR_ID_INTEL ; k->class_id =PCI_CLASS_NETWORK_ETHERNET ;
hw/net/etraxfs_eth.c +1 -1
@@ -628,7 +628,7 @@ static void etraxfs_eth_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = fs_eth_init; - dc->props = etraxfs_eth_properties; +device_class_set_props (dc, etraxfs_eth_properties);/* Reason: pointer properties "dma_out", "dma_in" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/net/fsl_etsec/etsec.c +1 -1
@@ -416,7 +416,7 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->realize = etsec_realize; dc->reset = etsec_reset; - dc->props = etsec_properties; +device_class_set_props (dc, etsec_properties); }static TypeInfo etsec_info = {
hw/net/imx_fec.c +1 -1
@@ -1189,7 +1189,7 @@ static void imx_eth_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_imx_eth; dc->reset = imx_eth_reset; - dc->props = imx_eth_properties; +device_class_set_props (dc, imx_eth_properties); dc->realize = imx_eth_realize; dc->desc ="i.MX FEC/ENET Ethernet Controller" ; }
hw/net/lan9118.c +1 -1
@@ -1365,7 +1365,7 @@ static void lan9118_class_init(ObjectClass *klass, void *data) k->init = lan9118_init1; dc->reset = lan9118_reset; - dc->props = lan9118_properties; +device_class_set_props (dc, lan9118_properties); dc->vmsd = &vmstate_lan9118; }
hw/net/lance.c +1 -1
@@ -163,7 +163,7 @@ static void lance_class_init(ObjectClass *klass, void *data) dc->fw_name ="ethernet" ; dc->reset = lance_reset; dc->vmsd = &vmstate_lance; - dc->props = lance_properties; +device_class_set_props (dc, lance_properties);/* Reason: pointer property "dma" */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/net/milkymist-minimac2.c +1 -1
@@ -526,7 +526,7 @@ static void milkymist_minimac2_class_init(ObjectClass *klass, void *data) k->init = milkymist_minimac2_init; dc->reset = milkymist_minimac2_reset; dc->vmsd = &vmstate_milkymist_minimac2; - dc->props = milkymist_minimac2_properties; +device_class_set_props (dc, milkymist_minimac2_properties); }static const TypeInfo milkymist_minimac2_info = {
hw/net/mipsnet.c +1 -1
@@ -274,7 +274,7 @@ static void mipsnet_class_init(ObjectClass *klass, void *data) dc->desc ="MIPS Simulator network device" ; dc->reset = mipsnet_sysbus_reset; dc->vmsd = &vmstate_mipsnet; - dc->props = mipsnet_properties; +device_class_set_props (dc, mipsnet_properties); }static const TypeInfo mipsnet_info = {
hw/net/ne2000-isa.c +1 -1
@@ -90,7 +90,7 @@ static void isa_ne2000_class_initfn(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = isa_ne2000_realizefn; - dc->props = ne2000_isa_properties; +device_class_set_props (dc, ne2000_isa_properties); dc->vmsd = &vmstate_isa_ne2000;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
hw/net/ne2000.c +1 -1
@@ -776,7 +776,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) k->device_id =PCI_DEVICE_ID_REALTEK_8029 ; k->class_id =PCI_CLASS_NETWORK_ETHERNET ; dc->vmsd = &vmstate_pci_ne2000; - dc->props = ne2000_properties; +device_class_set_props (dc, ne2000_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
hw/net/opencores_eth.c +1 -1
@@ -755,7 +755,7 @@ static void open_eth_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->desc ="Opencores 10/100 Mbit Ethernet" ; dc->reset = qdev_open_eth_reset; - dc->props = open_eth_properties; +device_class_set_props (dc, open_eth_properties); }static const TypeInfo open_eth_info = {
hw/net/pcnet-pci.c +1 -1
@@ -355,7 +355,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_NETWORK_ETHERNET ; dc->reset = pci_reset; dc->vmsd = &vmstate_pci_pcnet; - dc->props = pcnet_properties; +device_class_set_props (dc, pcnet_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
hw/net/rocker/rocker.c +1 -1
@@ -1565,7 +1565,7 @@ static void rocker_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->desc ="Rocker Switch" ; dc->reset = rocker_reset; - dc->props = rocker_properties; +device_class_set_props (dc, rocker_properties); dc->vmsd = &rocker_vmsd; }
hw/net/rtl8139.c +1 -1
@@ -3471,7 +3471,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_NETWORK_ETHERNET ; dc->reset = rtl8139_reset; dc->vmsd = &vmstate_rtl8139; - dc->props = rtl8139_properties; +device_class_set_props (dc, rtl8139_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
hw/net/smc91c111.c +1 -1
@@ -791,7 +791,7 @@ static void smc91c111_class_init(ObjectClass *klass, void *data) k->init = smc91c111_init1; dc->reset = smc91c111_reset; dc->vmsd = &vmstate_smc91c111; - dc->props = smc91c111_properties; +device_class_set_props (dc, smc91c111_properties); }static const TypeInfo smc91c111_info = {
hw/net/spapr_llan.c +1 -1
@@ -849,7 +849,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data) k->dt_compatible ="IBM,l-lan" ; k->signal_mask =0x1 ;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); - dc->props = spapr_vlan_properties; +device_class_set_props (dc, spapr_vlan_properties); k->rtce_window_size =0x10000000 ; dc->vmsd = &vmstate_spapr_llan; }
hw/net/stellaris_enet.c +1 -1
@@ -495,7 +495,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = stellaris_enet_init; - dc->props = stellaris_enet_properties; +device_class_set_props (dc, stellaris_enet_properties); dc->vmsd = &vmstate_stellaris_enet; }
hw/net/virtio-net.c +1 -1
@@ -1926,7 +1926,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_net_properties; +device_class_set_props (dc, virtio_net_properties); dc->vmsd = &vmstate_virtio_net;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); vdc->realize = virtio_net_device_realize;
hw/net/vmxnet3.c +1 -1
@@ -2715,7 +2715,7 @@ static void vmxnet3_class_init(ObjectClass *class, void *data) dc->desc ="VMWare Paravirtualized Ethernet v3" ; dc->reset = vmxnet3_qdev_reset; dc->vmsd = &vmstate_vmxnet3; - dc->props = vmxnet3_properties; +device_class_set_props (dc, vmxnet3_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
hw/net/xgmac.c +1 -1
@@ -415,7 +415,7 @@ static void xgmac_enet_class_init(ObjectClass *klass, void *data) sbc->init = xgmac_enet_init; dc->vmsd = &vmstate_xgmac; - dc->props = xgmac_properties; +device_class_set_props (dc, xgmac_properties); }static const TypeInfo xgmac_enet_info = {
hw/net/xilinx_axienet.c +1 -1
@@ -1031,7 +1031,7 @@ static void xilinx_enet_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = xilinx_enet_realize; - dc->props = xilinx_enet_properties; +device_class_set_props (dc, xilinx_enet_properties); dc->reset = xilinx_axienet_reset; }
hw/net/xilinx_ethlite.c +1 -1
@@ -261,7 +261,7 @@ static void xilinx_ethlite_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_ethlite_realize; dc->reset = xilinx_ethlite_reset; - dc->props = xilinx_ethlite_properties; +device_class_set_props (dc, xilinx_ethlite_properties); }static const TypeInfo xilinx_ethlite_info = {
hw/nvram/ds1225y.c +1 -1
@@ -152,7 +152,7 @@ static void nvram_sysbus_class_init(ObjectClass *klass, void *data) k->init = nvram_sysbus_initfn; dc->vmsd = &vmstate_nvram; - dc->props = nvram_sysbus_properties; +device_class_set_props (dc, nvram_sysbus_properties); }static const TypeInfo nvram_sysbus_info = {
hw/nvram/fw_cfg.c +2 -2
@@ -1029,7 +1029,7 @@ static void fw_cfg_io_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = fw_cfg_io_realize; - dc->props = fw_cfg_io_properties; +device_class_set_props (dc, fw_cfg_io_properties); }static const TypeInfo fw_cfg_io_info = {
@@ -1086,7 +1086,7 @@ static void fw_cfg_mem_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = fw_cfg_mem_realize; - dc->props = fw_cfg_mem_properties; +device_class_set_props (dc, fw_cfg_mem_properties); }static const TypeInfo fw_cfg_mem_info = {
hw/nvram/mac_nvram.c +1 -1
@@ -125,7 +125,7 @@ static void macio_nvram_class_init(ObjectClass *oc, void *data) dc->unrealize = macio_nvram_unrealizefn; dc->reset = macio_nvram_reset; dc->vmsd = &vmstate_macio_nvram; - dc->props = macio_nvram_properties; +device_class_set_props (dc, macio_nvram_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/nvram/spapr_nvram.c +1 -1
@@ -246,7 +246,7 @@ static void spapr_nvram_class_init(ObjectClass *klass, void *data) k->dt_type ="nvram" ; k->dt_compatible ="qemu,spapr-nvram" ;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = spapr_nvram_properties; +device_class_set_props (dc, spapr_nvram_properties); dc->vmsd = &vmstate_spapr_nvram; }
hw/pci-bridge/ioh3420.c +1 -1
@@ -202,7 +202,7 @@ static void ioh3420_class_init(ObjectClass *klass, void *data) dc->desc ="Intel IOH device id 3420 PCIE Root Port" ; dc->reset = ioh3420_reset; dc->vmsd = &vmstate_ioh3420; - dc->props = ioh3420_props; +device_class_set_props (dc, ioh3420_props); }static const TypeInfo ioh3420_info = {
hw/pci-bridge/pci_bridge_dev.c +1 -1
@@ -225,7 +225,7 @@ static void pci_bridge_dev_class_init(ObjectClass *klass, void *data) k->is_bridge =1 , dc->desc ="Standard PCI Bridge" ; dc->reset = qdev_pci_bridge_dev_reset; - dc->props = pci_bridge_dev_properties; +device_class_set_props (dc, pci_bridge_dev_properties); dc->vmsd = &pci_bridge_dev_vmstate;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); hc->plug = pci_bridge_dev_hotplug_cb;
hw/pci-bridge/pci_expander_bridge.c +2 -2
@@ -307,7 +307,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_BRIDGE_HOST ; dc->desc ="PCI Expander Bridge" ; - dc->props = pxb_dev_properties; +device_class_set_props (dc, pxb_dev_properties); dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }
@@ -341,7 +341,7 @@ static void pxb_pcie_dev_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_BRIDGE_HOST ; dc->desc ="PCI Express Expander Bridge" ; - dc->props = pxb_dev_properties; +device_class_set_props (dc, pxb_dev_properties); dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }
hw/pci-bridge/xio3130_downstream.c +1 -1
@@ -188,7 +188,7 @@ static void xio3130_downstream_class_init(ObjectClass *klass, void *data) dc->desc ="TI X3130 Downstream Port of PCI Express Switch" ; dc->reset = xio3130_downstream_reset; dc->vmsd = &vmstate_xio3130_downstream; - dc->props = xio3130_downstream_props; +device_class_set_props (dc, xio3130_downstream_props); }static const TypeInfo xio3130_downstream_info = {
hw/pci-host/piix.c +1 -1
@@ -872,7 +872,7 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) hc->root_bus_path = i440fx_pcihost_root_bus_path; dc->realize = i440fx_pcihost_realize; dc->fw_name ="pci" ; - dc->props = i440fx_props; +device_class_set_props (dc, i440fx_props);/* Reason: needs to be wired up by pc_init1 */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/pci-host/ppce500.c +1 -1
@@ -531,7 +531,7 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) k->init = e500_pcihost_initfn;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); - dc->props = pcihost_properties; +device_class_set_props (dc, pcihost_properties); dc->vmsd = &vmstate_ppce500_pci; }
hw/pci-host/prep.c +1 -1
@@ -386,7 +386,7 @@ static void raven_pcihost_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); dc->realize = raven_pcihost_realizefn; - dc->props = raven_pcihost_properties; +device_class_set_props (dc, raven_pcihost_properties); dc->fw_name ="pci" ; }
hw/pci-host/q35.c +1 -1
@@ -154,7 +154,7 @@ static void q35_host_class_init(ObjectClass *klass, void *data) hc->root_bus_path = q35_host_root_bus_path; dc->realize = q35_host_realize; - dc->props = mch_props; +device_class_set_props (dc, mch_props);/* Reason: needs to be wired up by pc_q35_init */ dc->cannot_instantiate_with_device_add_yet = true;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories);
hw/pci-host/versatile.c +1 -1
@@ -502,7 +502,7 @@ static void pci_vpb_class_init(ObjectClass *klass, void *data) dc->realize = pci_vpb_realize; dc->reset = pci_vpb_reset; dc->vmsd = &pci_vpb_vmstate; - dc->props = pci_vpb_properties; +device_class_set_props (dc, pci_vpb_properties);/* Reason: object_unref() hangs */ dc->cannot_destroy_with_object_finalize_yet = true; }
hw/pci/pci.c +1 -1
@@ -2492,7 +2492,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data) k->realize = pci_qdev_realize; k->unrealize = pci_qdev_unrealize; k->bus_type =TYPE_PCI_BUS ; - k->props = pci_props; +device_class_set_props (k, pci_props); pc->realize = pci_default_realize; }
hw/pci/pcie_port.c +2 -2
@@ -131,7 +131,7 @@ static void pcie_port_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = pcie_port_props; +device_class_set_props (dc, pcie_port_props); }static const TypeInfo pcie_port_type_info = {
@@ -153,7 +153,7 @@ static void pcie_slot_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (oc); - dc->props = pcie_slot_props; +device_class_set_props (dc, pcie_slot_props); hc->plug = pcie_cap_slot_hotplug_cb; hc->unplug_request = pcie_cap_slot_hot_unplug_request_cb; }
hw/ppc/pnv.c +1 -1
@@ -721,7 +721,7 @@ static void pnv_chip_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pnv_chip_realize; - dc->props = pnv_chip_properties; +device_class_set_props (dc, pnv_chip_properties); dc->desc ="PowerNV Chip" ; }
hw/ppc/pnv_core.c +1 -1
@@ -190,7 +190,7 @@ static void pnv_core_class_init(ObjectClass *oc, void *data)PnvCoreClass *pcc =PNV_CORE_CLASS (oc); dc->realize = pnv_core_realize; - dc->props = pnv_core_properties; +device_class_set_props (dc, pnv_core_properties); pcc->cpu_oc =cpu_class_by_name (TYPE_POWERPC_CPU , data); }
hw/ppc/spapr_pci.c +1 -1
@@ -1696,7 +1696,7 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) hc->root_bus_path = spapr_phb_root_bus_path; dc->realize = spapr_phb_realize; - dc->props = spapr_phb_properties; +device_class_set_props (dc, spapr_phb_properties); dc->reset = spapr_phb_reset; dc->vmsd = &vmstate_spapr_pci;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories);
hw/ppc/spapr_pci_vfio.c +1 -1
@@ -223,7 +223,7 @@ static void spapr_phb_vfio_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = spapr_phb_vfio_properties; +device_class_set_props (dc, spapr_phb_vfio_properties); }static const TypeInfo spapr_phb_vfio_info = {
hw/ppc/spapr_rng.c +1 -1
@@ -172,7 +172,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data) dc->realize = spapr_rng_realize;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = spapr_rng_properties; +device_class_set_props (dc, spapr_rng_properties); dc->hotpluggable = false; }
hw/ppc/spapr_vio.c +1 -1
@@ -586,7 +586,7 @@ static void vio_spapr_device_class_init(ObjectClass *klass, void *data) k->realize = spapr_vio_busdev_realize; k->reset = spapr_vio_busdev_reset; k->bus_type =TYPE_SPAPR_VIO_BUS ; - k->props = spapr_vio_props; +device_class_set_props (k, spapr_vio_props); }static const TypeInfo spapr_vio_type_info = {
hw/s390x/css-bridge.c +1 -1
@@ -125,7 +125,7 @@ static void virtual_css_bridge_class_init(ObjectClass *klass, void *data) hc->unplug = ccw_device_unplug;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); - dc->props = virtual_css_bridge_properties; +device_class_set_props (dc, virtual_css_bridge_properties); }static const TypeInfo virtual_css_bridge_info = {
hw/s390x/ipl.c +1 -1
@@ -315,7 +315,7 @@ static void s390_ipl_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = s390_ipl_realize; - dc->props = s390_ipl_properties; +device_class_set_props (dc, s390_ipl_properties); dc->reset = s390_ipl_reset; dc->vmsd = &vmstate_ipl;set_bit (DEVICE_CATEGORY_MISC , dc->categories);
hw/s390x/s390-pci-bus.c +1 -1
@@ -942,7 +942,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data) dc->reset = s390_pci_device_reset; dc->bus_type =TYPE_S390_PCI_BUS ; dc->realize = s390_pci_device_realize; - dc->props = s390_pci_device_properties; +device_class_set_props (dc, s390_pci_device_properties); }static const TypeInfo s390_pci_device_info = {
hw/s390x/virtio-ccw.c +9 -9
@@ -1347,7 +1347,7 @@ static void virtio_ccw_net_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_net_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_net_properties; +device_class_set_props (dc, virtio_ccw_net_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }
@@ -1376,7 +1376,7 @@ static void virtio_ccw_blk_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_blk_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_blk_properties; +device_class_set_props (dc, virtio_ccw_blk_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
@@ -1405,7 +1405,7 @@ static void virtio_ccw_serial_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_serial_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_serial_properties; +device_class_set_props (dc, virtio_ccw_serial_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
@@ -1434,7 +1434,7 @@ static void virtio_ccw_balloon_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_balloon_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_balloon_properties; +device_class_set_props (dc, virtio_ccw_balloon_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
@@ -1463,7 +1463,7 @@ static void virtio_ccw_scsi_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_scsi_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_scsi_properties; +device_class_set_props (dc, virtio_ccw_scsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
@@ -1491,7 +1491,7 @@ static void vhost_ccw_scsi_class_init(ObjectClass *klass, void *data) k->realize = vhost_ccw_scsi_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = vhost_ccw_scsi_properties; +device_class_set_props (dc, vhost_ccw_scsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
@@ -1531,7 +1531,7 @@ static void virtio_ccw_rng_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_rng_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_rng_properties; +device_class_set_props (dc, virtio_ccw_rng_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
@@ -1657,7 +1657,7 @@ static void virtio_ccw_9p_class_init(ObjectClass *klass, void *data) k->exit = virtio_ccw_exit; k->realize = virtio_ccw_9p_realize; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_9p_properties; +device_class_set_props (dc, virtio_ccw_9p_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
@@ -1708,7 +1708,7 @@ static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data) k->realize = vhost_vsock_ccw_realize; k->exit = virtio_ccw_exit;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = vhost_vsock_ccw_properties; +device_class_set_props (dc, vhost_vsock_ccw_properties); dc->reset = virtio_ccw_reset; }
hw/scsi/megasas.c +1 -1
@@ -2515,7 +2515,7 @@ static void megasas_class_init(ObjectClass *oc, void *data) e->osts = info->osts; e->product_name = info->product_name; e->product_version = info->product_version; - dc->props = info->props; +device_class_set_props (dc, info->props); dc->reset = megasas_scsi_reset; dc->vmsd = info->vmsd;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories);
hw/scsi/mptsas.c +1 -1
@@ -1434,7 +1434,7 @@ static void mptsas1068_class_init(ObjectClass *oc, void *data) pc->subsystem_vendor_id =PCI_VENDOR_ID_LSI_LOGIC ; pc->subsystem_id =0x8000 ; pc->class_id =PCI_CLASS_STORAGE_SCSI ; - dc->props = mptsas_properties; +device_class_set_props (dc, mptsas_properties); dc->reset = mptsas_reset; dc->vmsd = &vmstate_mptsas; dc->desc ="LSI SAS 1068" ;
hw/scsi/scsi-bus.c +1 -1
@@ -2069,7 +2069,7 @@ static void scsi_device_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_SCSI_BUS ; k->realize = scsi_qdev_realize; k->unrealize = scsi_qdev_unrealize; - k->props = scsi_props; +device_class_set_props (k, scsi_props); }static void scsi_dev_instance_init (Object *obj)
hw/scsi/scsi-disk.c +4 -4
@@ -2897,7 +2897,7 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc ="virtual SCSI disk" ; - dc->props = scsi_hd_properties; +device_class_set_props (dc, scsi_hd_properties); dc->vmsd = &vmstate_scsi_disk_state; }
@@ -2926,7 +2926,7 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc ="virtual SCSI CD-ROM" ; - dc->props = scsi_cd_properties; +device_class_set_props (dc, scsi_cd_properties); dc->vmsd = &vmstate_scsi_disk_state; }
@@ -2955,7 +2955,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data) sdc->dma_writev = scsi_block_dma_writev; sdc->need_fua_emulation = scsi_block_no_fua; dc->desc ="SCSI block device passthrough" ; - dc->props = scsi_block_properties; +device_class_set_props (dc, scsi_block_properties); dc->vmsd = &vmstate_scsi_disk_state; }
@@ -2993,7 +2993,7 @@ static void scsi_disk_class_initfn(ObjectClass *klass, void *data) dc->fw_name ="disk" ; dc->desc ="virtual SCSI disk or CD-ROM (legacy)" ; dc->reset = scsi_disk_reset; - dc->props = scsi_disk_properties; +device_class_set_props (dc, scsi_disk_properties); dc->vmsd = &vmstate_scsi_disk_state; }
hw/scsi/scsi-generic.c +1 -1
@@ -605,7 +605,7 @@ static void scsi_generic_class_initfn(ObjectClass *klass, void *data) dc->fw_name ="disk" ; dc->desc ="pass through generic scsi device (/dev/sg*)" ; dc->reset = scsi_generic_reset; - dc->props = scsi_generic_properties; +device_class_set_props (dc, scsi_generic_properties); dc->vmsd = &vmstate_scsi_device; }
hw/scsi/spapr_vscsi.c +1 -1
@@ -1268,7 +1268,7 @@ static void spapr_vscsi_class_init(ObjectClass *klass, void *data) k->dt_compatible ="IBM,v-scsi" ; k->signal_mask =0x00000001 ;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = spapr_vscsi_properties; +device_class_set_props (dc, spapr_vscsi_properties); k->rtce_window_size =0x10000000 ; dc->vmsd = &vmstate_spapr_vscsi; }
hw/scsi/vhost-scsi.c +1 -1
@@ -314,7 +314,7 @@ static void vhost_scsi_class_init(ObjectClass *klass, void *data)VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass);FWPathProviderClass *fwc =FW_PATH_PROVIDER_CLASS (klass); - dc->props = vhost_scsi_properties; +device_class_set_props (dc, vhost_scsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = vhost_scsi_realize; vdc->unrealize = vhost_scsi_unrealize;
hw/scsi/virtio-scsi.c +1 -1
@@ -949,7 +949,7 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data)VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (klass); - dc->props = virtio_scsi_properties; +device_class_set_props (dc, virtio_scsi_properties); dc->vmsd = &vmstate_virtio_scsi;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = virtio_scsi_device_realize;
hw/scsi/vmw_pvscsi.c +1 -1
@@ -1292,7 +1292,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data) dc->realize = pvscsi_realize; dc->reset = pvscsi_reset; dc->vmsd = &vmstate_pvscsi; - dc->props = pvscsi_properties; +device_class_set_props (dc, pvscsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); hc->unplug = pvscsi_hot_unplug; hc->plug = pvscsi_hotplug;
hw/sd/sd.c +1 -1
@@ -1914,7 +1914,7 @@ static void sd_class_init(ObjectClass *klass, void *data)SDCardClass *sc =SD_CARD_CLASS (klass); dc->realize = sd_realize; - dc->props = sd_properties; +device_class_set_props (dc, sd_properties); dc->vmsd = &sd_vmstate; dc->reset = sd_reset; dc->bus_type =TYPE_SD_BUS ;
hw/sd/sdhci.c +2 -2
@@ -1305,7 +1305,7 @@ static void sdhci_pci_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_SYSTEM_SDHCI ;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->vmsd = &sdhci_vmstate; - dc->props = sdhci_pci_properties; +device_class_set_props (dc, sdhci_pci_properties); dc->reset = sdhci_poweron_reset; }
@@ -1356,7 +1356,7 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &sdhci_vmstate; - dc->props = sdhci_sysbus_properties; +device_class_set_props (dc, sdhci_sysbus_properties); dc->realize = sdhci_sysbus_realize; dc->reset = sdhci_poweron_reset; }
hw/sparc/sun4m.c +2 -2
@@ -728,7 +728,7 @@ static void prom_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = prom_init1; - dc->props = prom_properties; +device_class_set_props (dc, prom_properties); }static const TypeInfo prom_info = {
@@ -795,7 +795,7 @@ static void ram_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = ram_init1; - dc->props = ram_properties; +device_class_set_props (dc, ram_properties); }static const TypeInfo ram_info = {
hw/sparc64/sun4u.c +2 -2
@@ -652,7 +652,7 @@ static void prom_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = prom_init1; - dc->props = prom_properties; +device_class_set_props (dc, prom_properties); }static const TypeInfo prom_info = {
@@ -713,7 +713,7 @@ static void ram_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = ram_init1; - dc->props = ram_properties; +device_class_set_props (dc, ram_properties); }static const TypeInfo ram_info = {
hw/ssi/aspeed_smc.c +1 -1
@@ -605,7 +605,7 @@ static void aspeed_smc_class_init(ObjectClass *klass, void *data) dc->realize = aspeed_smc_realize; dc->reset = aspeed_smc_reset; - dc->props = aspeed_smc_properties; +device_class_set_props (dc, aspeed_smc_properties); dc->vmsd = &vmstate_aspeed_smc; mc->ctrl = data; }
hw/ssi/xilinx_spi.c +1 -1
@@ -372,7 +372,7 @@ static void xilinx_spi_class_init(ObjectClass *klass, void *data) k->init = xilinx_spi_init; dc->reset = xlx_spi_reset; - dc->props = xilinx_spi_properties; +device_class_set_props (dc, xilinx_spi_properties); dc->vmsd = &vmstate_xilinx_spi; }
hw/ssi/xilinx_spips.c +1 -1
@@ -705,7 +705,7 @@ static void xilinx_spips_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_spips_realize; dc->reset = xilinx_spips_reset; - dc->props = xilinx_spips_properties; +device_class_set_props (dc, xilinx_spips_properties); dc->vmsd = &vmstate_xilinx_spips; xsc->reg_ops = &spips_ops;
hw/timer/a9gtimer.c +1 -1
@@ -354,7 +354,7 @@ static void a9_gtimer_class_init(ObjectClass *klass, void *data) dc->realize = a9_gtimer_realize; dc->vmsd = &vmstate_a9_gtimer; dc->reset = a9_gtimer_reset; - dc->props = a9_gtimer_properties; +device_class_set_props (dc, a9_gtimer_properties); }static const TypeInfo a9_gtimer_info = {
hw/timer/allwinner-a10-pit.c +1 -1
@@ -276,7 +276,7 @@ static void a10_pit_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = a10_pit_reset; - dc->props = a10_pit_properties; +device_class_set_props (dc, a10_pit_properties); dc->desc ="allwinner a10 timer" ; dc->vmsd = &vmstate_a10_pit; }
hw/timer/arm_mptimer.c +1 -1
@@ -299,7 +299,7 @@ static void arm_mptimer_class_init(ObjectClass *klass, void *data) dc->realize = arm_mptimer_realize; dc->vmsd = &vmstate_arm_mptimer; dc->reset = arm_mptimer_reset; - dc->props = arm_mptimer_properties; +device_class_set_props (dc, arm_mptimer_properties); }static const TypeInfo arm_mptimer_info = {
hw/timer/arm_timer.c +1 -1
@@ -389,7 +389,7 @@ static void sp804_class_init(ObjectClass *klass, void *data)DeviceClass *k =DEVICE_CLASS (klass); k->realize = sp804_realize; - k->props = sp804_properties; +device_class_set_props (k, sp804_properties); k->vmsd = &vmstate_sp804; }
hw/timer/grlib_gptimer.c +1 -1
@@ -394,7 +394,7 @@ static void grlib_gptimer_class_init(ObjectClass *klass, void *data) k->init = grlib_gptimer_init; dc->reset = grlib_gptimer_reset; - dc->props = grlib_gptimer_properties; +device_class_set_props (dc, grlib_gptimer_properties); }static const TypeInfo grlib_gptimer_info = {
hw/timer/hpet.c +1 -1
@@ -770,7 +770,7 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->realize = hpet_realize; dc->reset = hpet_reset; dc->vmsd = &vmstate_hpet; - dc->props = hpet_device_properties; +device_class_set_props (dc, hpet_device_properties); }static const TypeInfo hpet_device_info = {
hw/timer/i8254.c +1 -1
@@ -365,7 +365,7 @@ static void pit_class_initfn(ObjectClass *klass, void *data) k->get_channel_info = pit_get_channel_info_common; k->post_load = pit_post_load; dc->reset = pit_reset; - dc->props = pit_properties; +device_class_set_props (dc, pit_properties); }static const TypeInfo pit_info = {
hw/timer/lm32_timer.c +1 -1
@@ -222,7 +222,7 @@ static void lm32_timer_class_init(ObjectClass *klass, void *data) dc->realize = lm32_timer_realize; dc->reset = timer_reset; dc->vmsd = &vmstate_lm32_timer; - dc->props = lm32_timer_properties; +device_class_set_props (dc, lm32_timer_properties); }static const TypeInfo lm32_timer_info = {
hw/timer/m48t59.c +2 -2
@@ -822,7 +822,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void *data) dc->realize = m48t59_isa_realize; dc->reset = m48t59_reset_isa; - dc->props = m48t59_isa_properties; +device_class_set_props (dc, m48t59_isa_properties); nc->read = m48txx_isa_read; nc->write = m48txx_isa_write; nc->toggle_lock = m48txx_isa_toggle_lock;
@@ -867,7 +867,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data) k->init = m48t59_init1; dc->reset = m48t59_reset_sysbus; - dc->props = m48t59_sysbus_properties; +device_class_set_props (dc, m48t59_sysbus_properties); nc->read = m48txx_sysbus_read; nc->write = m48txx_sysbus_write; nc->toggle_lock = m48txx_sysbus_toggle_lock;
hw/timer/mc146818rtc.c +1 -1
@@ -952,7 +952,7 @@ static void rtc_class_initfn(ObjectClass *klass, void *data) dc->realize = rtc_realizefn; dc->vmsd = &vmstate_rtc; - dc->props = mc146818rtc_properties; +device_class_set_props (dc, mc146818rtc_properties);/* Reason: needs to be wired up by rtc_init() */ dc->cannot_instantiate_with_device_add_yet = true; }
hw/timer/milkymist-sysctl.c +1 -1
@@ -328,7 +328,7 @@ static void milkymist_sysctl_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_sysctl_realize; dc->reset = milkymist_sysctl_reset; dc->vmsd = &vmstate_milkymist_sysctl; - dc->props = milkymist_sysctl_properties; +device_class_set_props (dc, milkymist_sysctl_properties); }static const TypeInfo milkymist_sysctl_info = {
hw/timer/pxa2xx_timer.c +2 -2
@@ -546,7 +546,7 @@ static void pxa25x_timer_dev_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->desc ="PXA25x timer" ; - dc->props = pxa25x_timer_dev_properties; +device_class_set_props (dc, pxa25x_timer_dev_properties); }static const TypeInfo pxa25x_timer_dev_info = {
@@ -568,7 +568,7 @@ static void pxa27x_timer_dev_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->desc ="PXA27x timer" ; - dc->props = pxa27x_timer_dev_properties; +device_class_set_props (dc, pxa27x_timer_dev_properties); }static const TypeInfo pxa27x_timer_dev_info = {
hw/timer/slavio_timer.c +1 -1
@@ -417,7 +417,7 @@ static void slavio_timer_class_init(ObjectClass *klass, void *data) k->init = slavio_timer_init1; dc->reset = slavio_timer_reset; dc->vmsd = &vmstate_slavio_timer; - dc->props = slavio_timer_properties; +device_class_set_props (dc, slavio_timer_properties); }static const TypeInfo slavio_timer_info = {
hw/timer/stm32f2xx_timer.c +1 -1
@@ -319,7 +319,7 @@ static void stm32f2xx_timer_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = stm32f2xx_timer_reset; - dc->props = stm32f2xx_timer_properties; +device_class_set_props (dc, stm32f2xx_timer_properties); dc->vmsd = &vmstate_stm32f2xx_timer; }
hw/timer/xilinx_timer.c +1 -1
@@ -247,7 +247,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = xilinx_timer_realize; - dc->props = xilinx_timer_properties; +device_class_set_props (dc, xilinx_timer_properties); }static const TypeInfo xilinx_timer_info = {
hw/tpm/tpm_tis.c +1 -1
@@ -1079,7 +1079,7 @@ static void tpm_tis_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = tpm_tis_realizefn; - dc->props = tpm_tis_properties; +device_class_set_props (dc, tpm_tis_properties); dc->reset = tpm_tis_reset; dc->vmsd = &vmstate_tpm_tis; }
hw/usb/bus.c +1 -1
@@ -791,7 +791,7 @@ static void usb_device_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_USB_BUS ; k->realize = usb_qdev_realize; k->unrealize = usb_qdev_unrealize; - k->props = usb_props; +device_class_set_props (k, usb_props); }static const TypeInfo usb_device_type_info = {
hw/usb/ccid-card-emulated.c +1 -1
@@ -588,7 +588,7 @@ static void emulated_class_initfn(ObjectClass *klass, void *data) cc->apdu_from_guest = emulated_apdu_from_guest;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="emulated smartcard" ; - dc->props = emulated_card_properties; +device_class_set_props (dc, emulated_card_properties); }static const TypeInfo emulated_card_info = {
hw/usb/ccid-card-passthru.c +1 -1
@@ -402,7 +402,7 @@ static void passthru_class_initfn(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="passthrough smartcard" ; dc->vmsd = &passthru_vmstate; - dc->props = passthru_card_properties; +device_class_set_props (dc, passthru_card_properties); }static const TypeInfo passthru_card_info = {
hw/usb/dev-audio.c +1 -1
@@ -675,7 +675,7 @@ static void usb_audio_class_init(ObjectClass *klass, void *data)USBDeviceClass *k =USB_DEVICE_CLASS (klass); dc->vmsd = &vmstate_usb_audio; - dc->props = usb_audio_properties; +device_class_set_props (dc, usb_audio_properties);set_bit (DEVICE_CATEGORY_SOUND , dc->categories); k->product_desc ="QEMU USB Audio Interface" ; k->usb_desc = &desc_audio;
hw/usb/dev-hid.c +3 -3
@@ -812,7 +812,7 @@ static void usb_tablet_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_tablet_realize; uc->product_desc ="QEMU USB Tablet" ; dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_tablet_properties; +device_class_set_props (dc, usb_tablet_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
@@ -835,7 +835,7 @@ static void usb_mouse_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_mouse_realize; uc->product_desc ="QEMU USB Mouse" ; dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_mouse_properties; +device_class_set_props (dc, usb_mouse_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
@@ -859,7 +859,7 @@ static void usb_keyboard_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_keyboard_realize; uc->product_desc ="QEMU USB Keyboard" ; dc->vmsd = &vmstate_usb_kbd; - dc->props = usb_keyboard_properties; +device_class_set_props (dc, usb_keyboard_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
hw/usb/dev-mtp.c +1 -1
@@ -1583,7 +1583,7 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data) uc->handle_data = usb_mtp_handle_data; dc->fw_name ="mtp" ; dc->vmsd = &vmstate_usb_mtp; - dc->props = mtp_properties; +device_class_set_props (dc, mtp_properties); }static TypeInfo mtp_info = {
hw/usb/dev-network.c +1 -1
@@ -1432,7 +1432,7 @@ static void usb_net_class_initfn(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->fw_name ="network" ; dc->vmsd = &vmstate_usb_net; - dc->props = net_properties; +device_class_set_props (dc, net_properties); }static const TypeInfo net_info = {
hw/usb/dev-serial.c +2 -2
@@ -613,7 +613,7 @@ static void usb_serial_class_initfn(ObjectClass *klass, void *data) uc->product_desc ="QEMU USB Serial" ; uc->usb_desc = &desc_serial; - dc->props = serial_properties; +device_class_set_props (dc, serial_properties); }static const TypeInfo serial_info = {
@@ -634,7 +634,7 @@ static void usb_braille_class_initfn(ObjectClass *klass, void *data) uc->product_desc ="QEMU USB Braille" ; uc->usb_desc = &desc_braille; - dc->props = braille_properties; +device_class_set_props (dc, braille_properties); }static const TypeInfo braille_info = {
hw/usb/dev-smartcard-reader.c +2 -2
@@ -1462,7 +1462,7 @@ static void ccid_class_initfn(ObjectClass *klass, void *data) uc->handle_destroy = ccid_handle_destroy; dc->desc ="CCID Rev 1.1 smartcard reader" ; dc->vmsd = &ccid_vmstate; - dc->props = ccid_properties; +device_class_set_props (dc, ccid_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); hc->unplug = qdev_simple_device_unplug_cb; }
@@ -1484,7 +1484,7 @@ static void ccid_card_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_CCID_BUS ; k->init = ccid_card_init; k->exit = ccid_card_exit; - k->props = ccid_props; +device_class_set_props (k, ccid_props); }static const TypeInfo ccid_card_type_info = {
hw/usb/dev-storage.c +1 -1
@@ -755,7 +755,7 @@ static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data)USBDeviceClass *uc =USB_DEVICE_CLASS (klass); uc->realize = usb_msd_realize_storage; - dc->props = msd_properties; +device_class_set_props (dc, msd_properties); } static void usb_msd_get_bootindex(Object *obj, Visitor *v, const char *name,
hw/usb/dev-uas.c +1 -1
@@ -948,7 +948,7 @@ static void usb_uas_class_initfn(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->fw_name ="storage" ; dc->vmsd = &vmstate_usb_uas; - dc->props = uas_properties; +device_class_set_props (dc, uas_properties); }static const TypeInfo uas_info = {
hw/usb/hcd-ehci-pci.c +1 -1
@@ -150,7 +150,7 @@ static void ehci_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_SERIAL_USB ; k->config_write = usb_ehci_pci_write_config; dc->vmsd = &vmstate_ehci_pci; - dc->props = ehci_pci_properties; +device_class_set_props (dc, ehci_pci_properties); dc->reset = usb_ehci_pci_reset; }
hw/usb/hcd-ehci-sysbus.c +1 -1
@@ -79,7 +79,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = usb_ehci_sysbus_realize; dc->vmsd = &vmstate_ehci_sysbus; - dc->props = ehci_sysbus_properties; +device_class_set_props (dc, ehci_sysbus_properties); dc->reset = usb_ehci_sysbus_reset;set_bit (DEVICE_CATEGORY_USB , dc->categories); }
hw/usb/hcd-ohci.c +2 -2
@@ -2124,7 +2124,7 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_SERIAL_USB ;set_bit (DEVICE_CATEGORY_USB , dc->categories); dc->desc ="Apple USB Controller" ; - dc->props = ohci_pci_properties; +device_class_set_props (dc, ohci_pci_properties); dc->hotpluggable = false; dc->vmsd = &vmstate_ohci; dc->reset = usb_ohci_reset_pci;
@@ -2150,7 +2150,7 @@ static void ohci_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = ohci_realize_pxa;set_bit (DEVICE_CATEGORY_USB , dc->categories); dc->desc ="OHCI USB Controller" ; - dc->props = ohci_sysbus_properties; +device_class_set_props (dc, ohci_sysbus_properties); dc->reset = usb_ohci_reset_sysbus; }
hw/usb/hcd-uhci.c +2 -2
@@ -1340,9 +1340,9 @@ static void uhci_data_class_init(ObjectClass *klass, void *data)if (!info->unplug) {/* uhci controllers in companion setups can't be hotplugged */ dc->hotpluggable = false; - dc->props = uhci_properties_companion; +device_class_set_props (dc, uhci_properties_companion); }else { - dc->props = uhci_properties_standalone; +device_class_set_props (dc, uhci_properties_standalone); } u->info = *info; }
hw/usb/hcd-xhci.c +1 -1
@@ -3945,7 +3945,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_xhci; - dc->props = xhci_properties; +device_class_set_props (dc, xhci_properties); dc->reset = xhci_reset;set_bit (DEVICE_CATEGORY_USB , dc->categories); k->realize = usb_xhci_realize;
hw/usb/host-libusb.c +1 -1
@@ -1573,7 +1573,7 @@ static void usb_host_class_initfn(ObjectClass *klass, void *data) uc->alloc_streams = usb_host_alloc_streams; uc->free_streams = usb_host_free_streams; dc->vmsd = &vmstate_usb_host; - dc->props = usb_host_dev_properties; +device_class_set_props (dc, usb_host_dev_properties);set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }
hw/usb/redirect.c +1 -1
@@ -2508,7 +2508,7 @@ static void usbredir_class_initfn(ObjectClass *klass, void *data) uc->alloc_streams = usbredir_alloc_streams; uc->free_streams = usbredir_free_streams; dc->vmsd = &usbredir_vmstate; - dc->props = usbredir_properties; +device_class_set_props (dc, usbredir_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }
hw/vfio/pci.c +1 -1
@@ -2886,7 +2886,7 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pdc =PCI_DEVICE_CLASS (klass); dc->reset = vfio_pci_reset; - dc->props = vfio_pci_dev_properties; +device_class_set_props (dc, vfio_pci_dev_properties); dc->vmsd = &vfio_pci_vmstate; dc->desc ="VFIO-based PCI device assignment" ;set_bit (DEVICE_CATEGORY_MISC , dc->categories);
hw/vfio/platform.c +1 -1
@@ -691,7 +691,7 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *sbc =SYS_BUS_DEVICE_CLASS (klass); dc->realize = vfio_platform_realize; - dc->props = vfio_platform_dev_properties; +device_class_set_props (dc, vfio_platform_dev_properties); dc->vmsd = &vfio_platform_vmstate; dc->desc ="VFIO-based platform device assignment" ; sbc->connect_irq_notifier = vfio_start_irqfd_injection;
hw/virtio/vhost-vsock.c +1 -1
@@ -390,7 +390,7 @@ static void vhost_vsock_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = vhost_vsock_properties; +device_class_set_props (dc, vhost_vsock_properties); dc->vmsd = &vmstate_virtio_vhost_vsock;set_bit (DEVICE_CATEGORY_MISC , dc->categories); vdc->realize = vhost_vsock_device_realize;
hw/virtio/virtio-balloon.c +1 -1
@@ -508,7 +508,7 @@ static void virtio_balloon_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_balloon_properties; +device_class_set_props (dc, virtio_balloon_properties); dc->vmsd = &vmstate_virtio_balloon;set_bit (DEVICE_CATEGORY_MISC , dc->categories); vdc->realize = virtio_balloon_device_realize;
hw/virtio/virtio-mmio.c +1 -1
@@ -496,7 +496,7 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data) dc->realize = virtio_mmio_realizefn; dc->reset = virtio_mmio_reset;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = virtio_mmio_properties; +device_class_set_props (dc, virtio_mmio_properties); }static const TypeInfo virtio_mmio_info = {
hw/virtio/virtio-pci.c +10 -10
@@ -1137,7 +1137,7 @@ static void virtio_9p_pci_class_init(ObjectClass *klass, void *data) pcidev_k->revision =VIRTIO_PCI_ABI_VERSION ; pcidev_k->class_id =0x2 ;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = virtio_9p_pci_properties; +device_class_set_props (dc, virtio_9p_pci_properties); }static void virtio_9p_pci_instance_init (Object *obj)
@@ -1899,7 +1899,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *k =PCI_DEVICE_CLASS (klass);VirtioPCIClass *vpciklass =VIRTIO_PCI_CLASS (klass); - dc->props = virtio_pci_properties; +device_class_set_props (dc, virtio_pci_properties); k->realize = virtio_pci_realize; k->exit = virtio_pci_exit; k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ;
@@ -1945,7 +1945,7 @@ static void virtio_blk_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = virtio_blk_pci_properties; +device_class_set_props (dc, virtio_blk_pci_properties); k->realize = virtio_blk_pci_realize; pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_BLOCK ;
@@ -2017,7 +2017,7 @@ static void virtio_scsi_pci_class_init(ObjectClass *klass, void *data) k->realize = virtio_scsi_pci_realize;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = virtio_scsi_pci_properties; +device_class_set_props (dc, virtio_scsi_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_SCSI ; pcidev_k->revision =0x00 ;
@@ -2072,7 +2072,7 @@ static void vhost_scsi_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = vhost_scsi_pci_realize;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = vhost_scsi_pci_properties; +device_class_set_props (dc, vhost_scsi_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_SCSI ; pcidev_k->revision =0x00 ;
@@ -2122,7 +2122,7 @@ static void vhost_vsock_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = vhost_vsock_pci_realize;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = vhost_vsock_pci_properties; +device_class_set_props (dc, vhost_vsock_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_VSOCK ; pcidev_k->revision =0x00 ;
@@ -2174,7 +2174,7 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = virtio_balloon_pci_realize;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = virtio_balloon_pci_properties; +device_class_set_props (dc, virtio_balloon_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_BALLOON ; pcidev_k->revision =VIRTIO_PCI_ABI_VERSION ;
@@ -2252,7 +2252,7 @@ static void virtio_serial_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = virtio_serial_pci_realize;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); - dc->props = virtio_serial_pci_properties; +device_class_set_props (dc, virtio_serial_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_CONSOLE ; pcidev_k->revision =VIRTIO_PCI_ABI_VERSION ;
@@ -2308,7 +2308,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data) k->revision =VIRTIO_PCI_ABI_VERSION ; k->class_id =PCI_CLASS_NETWORK_ETHERNET ;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); - dc->props = virtio_net_properties; +device_class_set_props (dc, virtio_net_properties); vpciklass->realize = virtio_net_pci_realize; }
@@ -2406,7 +2406,7 @@ static void virtio_input_pci_class_init(ObjectClass *klass, void *data)VirtioPCIClass *k =VIRTIO_PCI_CLASS (klass);PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); - dc->props = virtio_input_pci_properties; +device_class_set_props (dc, virtio_input_pci_properties); k->realize = virtio_input_pci_realize;set_bit (DEVICE_CATEGORY_INPUT , dc->categories);
hw/virtio/virtio-rng.c +1 -1
@@ -237,7 +237,7 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_rng_properties; +device_class_set_props (dc, virtio_rng_properties); dc->vmsd = &vmstate_virtio_rng;set_bit (DEVICE_CATEGORY_MISC , dc->categories); vdc->realize = virtio_rng_device_realize;
hw/virtio/virtio.c +1 -1
@@ -2166,7 +2166,7 @@ static void virtio_device_class_init(ObjectClass *klass, void *data) dc->realize = virtio_device_realize; dc->unrealize = virtio_device_unrealize; dc->bus_type =TYPE_VIRTIO_BUS ; - dc->props = virtio_properties; +device_class_set_props (dc, virtio_properties); }static const TypeInfo virtio_device_info = {
hw/xen/xen_backend.c +1 -1
@@ -877,7 +877,7 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = xen_sysdev_init; - dc->props = xen_sysdev_properties; +device_class_set_props (dc, xen_sysdev_properties); }static const TypeInfo xensysdev_info = {
hw/xen/xen_pt.c +1 -1
@@ -948,7 +948,7 @@ static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data) k->config_write = xen_pt_pci_write_config;set_bit (DEVICE_CATEGORY_MISC , dc->categories); dc->desc ="Assign an host PCI device with Xen" ; - dc->props = xen_pci_passthrough_properties; +device_class_set_props (dc, xen_pci_passthrough_properties); };static void xen_pci_passthrough_finalize (Object *obj)
include/hw/qdev-core.h +6 -0
@@ -401,6 +401,12 @@ static inline bool qbus_is_hotpluggable(BusState *bus)return bus->hotplug_handler; } +/* Set list of static properties for class +* +* It can be called only once per class. +*/ +void device_class_set_props (DeviceClass *dc,Property *props); +void device_listener_register (DeviceListener *listener);void device_listener_unregister (DeviceListener *listener);
target-arm/cpu.c +1 -1
@@ -1531,7 +1531,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) acc->parent_realize = dc->realize; dc->realize = arm_cpu_realizefn; - dc->props = arm_cpu_properties; +device_class_set_props (dc, arm_cpu_properties); acc->parent_reset = cc->reset; cc->reset = arm_cpu_reset;
target-i386/cpu.c +2 -2
@@ -1579,7 +1579,7 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)* instance_init, because they require KVM to be initialized. */ - dc->props = host_x86_cpu_properties; +device_class_set_props (dc, host_x86_cpu_properties);/* Reason: host_x86_cpu_initfn() dies when !kvm_enabled() */ dc->cannot_destroy_with_object_finalize_yet = true; }
@@ -3651,7 +3651,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) xcc->parent_unrealize = dc->unrealize; dc->realize = x86_cpu_realizefn; dc->unrealize = x86_cpu_unrealizefn; - dc->props = x86_cpu_properties; +device_class_set_props (dc, x86_cpu_properties); xcc->parent_reset = cc->reset; cc->reset = x86_cpu_reset;
target-microblaze/cpu.c +1 -1
@@ -269,7 +269,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->get_phys_page_debug = mb_cpu_get_phys_page_debug;#endif dc->vmsd = &vmstate_mb_cpu; - dc->props = mb_properties; +device_class_set_props (dc, mb_properties); cc->gdb_num_core_regs =32 +5 ; cc->disas_set_info = mb_disas_set_info;
target-ppc/translate_init.c +3 -3
@@ -8586,7 +8586,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER7" ; dc->desc ="POWER7" ; - dc->props = powerpc_servercpu_properties; +device_class_set_props (dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power7; pcc->pcr_mask =PCR_VEC_DIS |PCR_VSX_DIS |PCR_COMPAT_2_05 ; pcc->pcr_supported =PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ;
@@ -8713,7 +8713,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER8" ; dc->desc ="POWER8" ; - dc->props = powerpc_servercpu_properties; +device_class_set_props (dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power8; pcc->pcr_mask =PCR_TM_DIS |PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; pcc->pcr_supported =PCR_COMPAT_2_07 |PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ;
@@ -8794,7 +8794,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER9" ; dc->desc ="POWER9" ; - dc->props = powerpc_servercpu_properties; +device_class_set_props (dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power9; pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 ; pcc->init_proc = init_proc_POWER9;
tests/test-qdev-global-props.c +1 -1
@@ -53,7 +53,7 @@ static void static_prop_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize =NULL ; - dc->props = static_props; +device_class_set_props (dc, static_props); }static const TypeInfo static_prop_type = {
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v4 2/8] tests: check-qom-proplist: Use &error_abort to catch errors
In reply to Eduardo HabkostQuoted 47 lines · On Fri, 28 Oct 2016 23:48:01 -0200 Eduardo Habkost <[email protected]> wrote:
Use
&error_abortso we don't ignore any errors on the property registration calls.Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v2 -> v3:
* Patch imported from "tests: A few check-qom-proplist fixes" seriesChanges series v3 -> v4:
* Added&error_abortto more object_property_{add,del}_*() calls
* Suggested-by: Igor Mammedov <[email protected]>--- tests/check-qom-proplist.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)tests/check-qom-proplist.c +3
-3@@ -123,7 +123,7 @@ static void dummy_init(Object *obj)object_property_add_bool (obj,"bv" , dummy_get_bv, dummy_set_bv, -NULL ); + &error_abort); }@@ -132,13 +132,13 @@ static void dummy_class_init(ObjectClass *cls, void *data)object_class_property_add_str (cls,"sv" , dummy_get_sv, dummy_set_sv, -NULL ); + &error_abort);object_class_property_add_enum (cls,"av" ,"DummyAnimal" , dummy_animal_map, dummy_get_av, dummy_set_av, -NULL ); + &error_abort); }
tests/check-qom-proplist.c static void dummy_dev_init(Object *obj) · line 244
Quoted 8 lines
tests/check-qom-proplist.c +2
-2@@ -239,13 +239,13 @@ static void dummy_dev_init(Object *obj)DummyBus *bus =DUMMY_BUS (object_new (TYPE_DUMMY_BUS ));DummyBackend *backend =DUMMY_BACKEND (object_new (TYPE_DUMMY_BACKEND )); -object_property_add_child (obj,"bus" ,OBJECT (bus),NULL ); +object_property_add_child (obj,"bus" ,OBJECT (bus), &error_abort); dev->bus = bus; -object_property_add_child (OBJECT (bus),"backend" ,OBJECT (backend),NULL ); +object_property_add_child (OBJECT (bus),"backend" ,OBJECT (backend), &error_abort);
looks like line is over 80 characters
with that fixed
Quoted 17 lines
tests/check-qom-proplist.c +2
-2bus->backend = backend;object_property_add_link (obj,"backend" ,TYPE_DUMMY_BACKEND , - (Object **)&bus->backend,NULL ,0 ,NULL ); + (Object **)&bus->backend,NULL ,0 , &error_abort); }static void dummy_dev_unparent (Object *obj)@@ -274,7 +274,7 @@ static void dummy_bus_init(Object *obj)static void dummy_bus_unparent (Object *obj) {DummyBus *bus =DUMMY_BUS (obj); -object_property_del (obj->parent,"backend" ,NULL ); +object_property_del (obj->parent,"backend" , &error_abort);object_unparent (OBJECT (bus->backend)); }
Re: [Qemu-devel] [PATCH v4 5/8] qdev: Register static properties as class properties
In reply to Eduardo HabkostQuoted 99 lines · On Fri, 28 Oct 2016 23:48:04 -0200 Eduardo Habkost <[email protected]> wrote:
Instead of registering qdev static properties on
instance_init, register them as class properties, atqdev_class_set_props().
qdev_property_add_legacy()was replaced by an equivalentqdev_class_property_add_legacy()function.qdev_property_add_static(), on the other hand, can't be eliminated yet because it is used byarm_cpu_post_init().As class properties don't have a release function called when an object instance is destroyed, the release functions for properties are called manually from
device_finalize().Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v1 -> v2:
* (none)Changes v2 -> v3:
* Fix code alignemnt
* Reported-by: Igor Mammedov <[email protected]>Changes series v3 -> v4:
* s/Device/Class/ onqdev_class_property_add_legacy()doc comment
* Reported-by: Igor Mammedov <[email protected]>
* Callprop->info->releaseoninstance_finalize(fix tests/drive_del-test failure)--- hw/core/qdev.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 13 deletions(-)hw/core/qdev.c +27
-10@@ -739,12 +739,12 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, }/** -* qdev_property_add_legacy: -* @dev: Device to add the property to. +* qdev_class_property_add_legacy: +* @oc: Class to add the property to. * @prop: The qdev property definition. * @errp: location to store error information. * -* Add a legacy QOM property to @dev for qdev property @prop. +* Add a legacy QOM property to @oc for qdev property @prop. * On error, store error in @errp. * * Legacy properties are string versions of QOM properties. The format of @@ -754,8 +754,8 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,* Do not use this is new code! QOM Properties added through this interface * will be given names in the "legacy" namespace. */ -static void qdev_property_add_legacy (DeviceState *dev,Property *prop, -Error **errp) +static void qdev_class_property_add_legacy (ObjectClass *oc,Property *prop, +Error **errp) {gchar *name;@@ -765,11 +765,12 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, } name =g_strdup_printf ("legacy-%s" , prop->name); -object_property_add (OBJECT (dev), name,"str" , - prop->info->print ? qdev_get_legacy_property : prop->info->get, -NULL , -NULL , - prop, errp); +object_class_property_add (oc, name,"str" , + prop->info->print ? + qdev_get_legacy_property : + prop->info->get, +NULL ,NULL , + prop, errp);g_free (name); }@@ -844,6 +845,48 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,qdev_property_set_to_default (dev, prop, &error_abort); } +/** +* qdev_class_property_add_static: +* @oc: Class to add the property to. +* @prop: The qdev property definition. +* @errp: location to store error information. +* +* Add a static QOM property to @oc for qdev property @prop. +* On error, store error in @errp. Static properties access data in a struct. +* The type of the QOM property is derived from prop->info. +*/ +static void qdev_class_property_add_static (ObjectClass *oc,Property *prop, +Error **errp) +{ +Error *local_err =NULL ; + +/*
hw/core/qdev.c void qdev_property_add_static(DeviceState *dev, Property *prop, · line 873
Quoted 10 lines
hw/core/qdev.c +10
-0+* TODO qdev_prop_ptr does not have getters or setters. It must +* go now that it can be replaced with links. The test should be +* removed along with it: all static properties are read/write. +*/ +if (!prop->info->get && !prop->info->set) { +return ; + } + +/* Note: prop->info->release is called on device_finalize(), +* because it needs to be called on instaqnce destruction, not on
s/instaqnce/instance/
with this fixed:
Quoted 63 lines
hw/core/qdev.c +32
-3+* class property removal. +*/ +object_class_property_add (oc, prop->name, prop->info->name, + prop->info->get, prop->info->set, +NULL , prop, &local_err); + +if (local_err) { +error_propagate (errp, local_err); +return ; + } + +object_class_property_set_description (oc, prop->name, + prop->info->description, + &error_abort); +} +/* @qdev_alias_all_properties - Add alias properties to the source object for * all qdev properties on the target DeviceState. */ @@ -867,8 +910,15 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)void device_class_set_props (DeviceClass *dc,Property *props) { +Property *prop; +ObjectClass *oc =OBJECT_CLASS (dc); +assert (!dc->props); dc->props = props; +for (prop = dc->props; prop && prop->name; prop++) { +qdev_class_property_add_legacy (oc, prop, &error_abort); +qdev_class_property_add_static (oc, prop, &error_abort); + } }static int qdev_add_hotpluggable_device (Object *obj,void *opaque)@@ -1068,8 +1118,7 @@ static void device_initfn(Object *obj) class =object_get_class (OBJECT (dev));do {for (prop =DEVICE_CLASS (class)->props; prop && prop->name; prop++) { -qdev_property_add_legacy (dev, prop, &error_abort); -qdev_property_add_static (dev, prop, &error_abort); +qdev_property_set_to_default (dev, prop, &error_abort); } class =object_class_get_parent (class); }while (class !=object_class_by_name (TYPE_DEVICE ));@@ -1088,9 +1137,16 @@ static void device_post_init(Object *obj)/* Unlink device from bus and free the structure. */ static void device_finalize (Object *obj) { +DeviceState *dev =DEVICE (obj); +DeviceClass *dc =DEVICE_GET_CLASS (dev); +Property *prop;NamedGPIOList *ngl, *next; -DeviceState *dev =DEVICE (obj); +for (prop = dc->props; prop && prop->name; prop++) { +if (prop->info->release) { + prop->info->release (obj, prop->name, prop); + } + } QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {QLIST_REMOVE (ngl, node);
Re: [Qemu-devel] [PATCH v4 6/8] qom: object_class_property_iter_init() function
In reply to Eduardo HabkostQuoted 5 lines · On Fri, 28 Oct 2016 23:48:05 -0200 Eduardo Habkost <[email protected]> wrote:
The new function will allow us to iterate over class properties using the same logic we use for object properties. Unit test included.
Signed-off-by Eduardo Habkost <[email protected]>
Quoted 111 lines
---
Changes series v1 -> v3:
* (none)Changes series v3 -> v4:
* Trivial whitespace change (removed extra newline)--- include/qom/object.h | 14 ++++++++++++++ qom/object.c | 10 ++++++++-- tests/check-qom-proplist.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-)include/qom/object.h +14
-0@@ -995,6 +995,20 @@ void object_property_iter_init(ObjectPropertyIterator *iter, Object *obj);/** +* object_class_property_iter_init: +* @klass: the class +* +* Initializes an iterator for traversing all properties +* registered against an object class and all parent classes. +* +* It is forbidden to modify the property list while iterating, +* whether removing or adding properties. +*/ +void object_class_property_iter_init (ObjectPropertyIterator *iter, +ObjectClass *klass); + + +/** * object_property_iter_next: * @iter: the iterator instance * qom/object.c +8
-2@@ -1010,6 +1010,13 @@ void object_property_iter_init(ObjectPropertyIterator *iter, iter->nextclass =object_get_class (obj); } +void object_class_property_iter_init (ObjectPropertyIterator *iter, +ObjectClass *klass) +{ +g_hash_table_iter_init (&iter->iter, klass->properties); + iter->nextclass =object_class_get_parent (klass); +} +ObjectProperty *object_property_iter_next (ObjectPropertyIterator *iter) {gpointer key, val;@@ -1017,8 +1024,7 @@ ObjectProperty *object_property_iter_next(ObjectPropertyIterator *iter)if (!iter->nextclass) {return NULL ; } -g_hash_table_iter_init (&iter->iter, iter->nextclass->properties); - iter->nextclass =object_class_get_parent (iter->nextclass); +object_class_property_iter_init (iter, iter->nextclass); }return val; }tests/check-qom-proplist.c +28
-0@@ -496,6 +496,33 @@ static void test_dummy_iterator(void) } +static void test_dummy_class_iterator (void ) +{ +ObjectClass *klass =object_class_by_name (TYPE_DUMMY ); +ObjectProperty *prop; +ObjectPropertyIterator iter; +bool seensv = false, seenav = false, seentype; + +object_class_property_iter_init (&iter, klass); +while ((prop =object_property_iter_next (&iter))) { +if (g_str_equal (prop->name,"sv" )) { + seensv = true; + }else if (g_str_equal (prop->name,"av" )) { + seenav = true; + }else if (g_str_equal (prop->name,"type" )) { +/* This prop comes from the base Object class */ + seentype = true; + }else { +g_printerr ("Found prop '%s'\n" , prop->name); +g_assert_not_reached (); + } + } +g_assert (seenav); +g_assert (seensv); +g_assert (seentype); +} + +static void test_dummy_delchild (void ) {Object *parent =object_get_objects_root ();@@ -524,6 +551,7 @@ int main(int argc, char **argv)g_test_add_func ("/qom/proplist/badenum" , test_dummy_badenum);g_test_add_func ("/qom/proplist/getenum" , test_dummy_getenum);g_test_add_func ("/qom/proplist/iterator" , test_dummy_iterator); +g_test_add_func ("/qom/proplist/class_iterator" , test_dummy_class_iterator);g_test_add_func ("/qom/proplist/delchild" , test_dummy_delchild);return g_test_run ();
Re: [Qemu-arm] [PATCH v4 8/8] qdev: Warning about using qdev_property_add_static() in new code
In reply to Eduardo HabkostQuoted 7 lines · On Fri, 28 Oct 2016 23:48:07 -0200 Eduardo Habkost <[email protected]> wrote:
The only remaining user of
qdev_property_add_static()isarm_cpu_post_init(), but removing it may take some work. While we don't change it, warn people to not use the function in new code.Cc Peter Maydell <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>
Quoted 27 lines
---
Changes series v1 -> v3:
* (none)Changes series v3 -> v4:
* Rewrote commit message to refer to correct function name
* s/qdev_class_set_props/device_class_set_props/ (function had been renamed in series v3)--- hw/core/qdev.c | 4 ++++ 1 file changed, 4 insertions(+)hw/core/qdev.c +4
-0@@ -812,6 +812,10 @@ static void qdev_property_set_to_default(DeviceState *dev, Property *prop,* Add a static QOM property to @dev for qdev property @prop. * On error, store error in @errp. Static properties access data in a struct. * The type of the QOM property is derived from prop->info. +* +* Do not use this in new code. Either use device_class_set_props(), +* or register regular QOM properties using object_property_add() or +* object_class_property_add(). */ void qdev_property_add_static (DeviceState *dev,Property *prop,Error **errp)
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
One question though,
How would management software discover typename of abstract class?
Perhaps this patch should be part of some other series.
Quoted 55 lines
Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v1 -> v2:
* (none)Changes series v2 -> v3:
* Reworded commit messageChanges series v3 -> v4:
* (none)--- qmp.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)qmp.c +9
-12@@ -518,7 +518,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, Error **errp) {ObjectClass *klass; -Object *obj; +Object *obj =NULL ;ObjectProperty *prop;ObjectPropertyIterator iter;DevicePropertyInfoList *prop_list =NULL ;@@ -537,19 +537,16 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, }if (object_class_is_abstract (klass)) { -error_setg (errp,QERR_INVALID_PARAMETER_VALUE ,"name" , -"non-abstract device type" ); -return NULL ; - } - -if (DEVICE_CLASS (klass)->cannot_destroy_with_object_finalize_yet) { -error_setg (errp,"Can't list properties of device '%s'" , typename); -return NULL ; +object_class_property_iter_init (&iter, klass); + }else { +if (DEVICE_CLASS (klass)->cannot_destroy_with_object_finalize_yet) { +error_setg (errp,"Can't list properties of device '%s'" , typename); +return NULL ; + } + obj =object_new (typename); +object_property_iter_init (&iter, obj); } - obj =object_new (typename); - -object_property_iter_init (&iter, obj);while ((prop =object_property_iter_next (&iter))) {DevicePropertyInfo *info;DevicePropertyInfoList *entry;
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
(CCing libvirt people, as I forgot to CC them)
Quoted 10 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Quoted 5 lines
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
One question though,
How would management software discover typename of abstract class?
It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Quoted 2 lines
Perhaps this patch should be part of some other series.
This is a valid point. In this case, it depends on the approach we want to take: do we want to provide a flexible interface for management, let them find ways to make it useful and give us feedback on what is lacking; or do we want to provide the new interface only after we have specified the complete solution for the problem?
I don't know the answer. I will let the qdev/QOM/QMP maintainers answer that.
Quoted 57 lines
Quoted 56 lines
Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v1 -> v2:
* (none)Changes series v2 -> v3:
* Reworded commit messageChanges series v3 -> v4:
* (none)--- qmp.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)qmp.c +9
-12@@ -518,7 +518,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, Error **errp) {ObjectClass *klass; -Object *obj; +Object *obj =NULL ;ObjectProperty *prop;ObjectPropertyIterator iter;DevicePropertyInfoList *prop_list =NULL ;@@ -537,19 +537,16 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, }if (object_class_is_abstract (klass)) { -error_setg (errp,QERR_INVALID_PARAMETER_VALUE ,"name" , -"non-abstract device type" ); -return NULL ; - } - -if (DEVICE_CLASS (klass)->cannot_destroy_with_object_finalize_yet) { -error_setg (errp,"Can't list properties of device '%s'" , typename); -return NULL ; +object_class_property_iter_init (&iter, klass); + }else { +if (DEVICE_CLASS (klass)->cannot_destroy_with_object_finalize_yet) { +error_setg (errp,"Can't list properties of device '%s'" , typename); +return NULL ; + } + obj =object_new (typename); +object_property_iter_init (&iter, obj); } - obj =object_new (typename); - -object_property_iter_init (&iter, obj);while ((prop =object_property_iter_next (&iter))) {DevicePropertyInfo *info;DevicePropertyInfoList *entry;
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 3/8] qdev: device_class_set_props() function
In reply to Eduardo HabkostQuoted 23 lines · On Fri, 28 Oct 2016 23:48:02 -0200 Eduardo Habkost <[email protected]> wrote:
Replace direct assignment of
DeviceClass::propswith adevice_class_set_props()function. The new function will handle registration of class properties, later.Most of the existing code was converted using the Coccinelle patch below. Exceptions are:
* manual conversion oftarget-ppc/translate_init.c;
* reordering of code ate1000e_class_init()to ensuredevice_class_set_props()is called after initialization of the PropertyInfo structs.Coccinelle patch:
@@ identifier DC; expression PROPS; typedef DeviceClass; @@ DeviceClass *DC; ... -DC->props = PROPS; +device_class_set_props(DC, PROPS);
Quoted 1 line
Signed-off-by Eduardo Habkost <[email protected]>
Quoted 4,204 lines
---
Changes v1 -> v2:
* s/qdev_class_set_props/device_class_set_props/
* Suggested-by: Andreas Färber <[email protected]>Changes v2 -> v3:
* Rebased to latest qemu.git masterChanges v3 -> v4:
* Fix e1000e initialization ordering (fixes "make check" failure)
* Reported-by: Igor Mammedov <[email protected]>
* Rebased to latest qemu.git master (new functions changed:
floppy_drive_class_init(),pnv_chip_class_init(),pnv_core_class_init())--- hw/9pfs/virtio-9p-device.c | 2 +- hw/acpi/piix4.c | 2 +- hw/arm/armv7m.c | 2 +- hw/arm/bcm2836.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/pxa2xx.c | 4 ++-- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stm32f205_soc.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/xlnx-zynqmp.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/hda-codec.c | 2 +- hw/audio/intel-hda.c | 4 ++-- hw/audio/marvell_88w8618.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/pl041.c | 2 +- hw/audio/sb16.c | 2 +- hw/block/fdc.c | 8 ++++---- hw/block/m25p80.c | 2 +- hw/block/nand.c | 2 +- hw/block/nvme.c | 2 +- hw/block/onenand.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/pflash_cfi02.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/char/bcm2835_aux.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/debugcon.c | 2 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/parallel.c | 2 +- hw/char/pl011.c | 2 +- hw/char/sclpconsole-lm.c | 2 +- hw/char/sclpconsole.c | 2 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci.c | 6 +++--- hw/char/spapr_vty.c | 2 +- hw/char/stm32f2xx_usart.c | 2 +- hw/char/virtio-console.c | 2 +- hw/char/virtio-serial-bus.c | 4 ++-- hw/char/xilinx_uartlite.c | 2 +- hw/core/generic-loader.c | 2 +- hw/core/or-irq.c | 2 +- hw/core/platform-bus.c | 2 +- hw/core/qdev.c | 6 ++++++ hw/cpu/a15mpcore.c | 2 +- hw/cpu/a9mpcore.c | 2 +- hw/cpu/arm11mpcore.c | 2 +- hw/cpu/realview_mpcore.c | 2 +- hw/display/bcm2835_fb.c | 2 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 4 ++-- hw/display/g364fb.c | 2 +- hw/display/milkymist-vgafb.c | 2 +- hw/display/qxl.c | 2 +- hw/display/tcx.c | 2 +- hw/display/vga-isa.c | 2 +- hw/display/vga-pci.c | 4 ++-- hw/display/virtio-gpu-pci.c | 2 +- hw/display/virtio-gpu.c | 2 +- hw/display/virtio-vga.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/pxa2xx_dma.c | 2 +- hw/dma/sparc32_dma.c | 2 +- hw/dma/sun4m_iommu.c | 2 +- hw/dma/xilinx_axidma.c | 2 +- hw/gpio/imx_gpio.c | 2 +- hw/gpio/omap_gpio.c | 4 ++-- hw/i2c/core.c | 2 +- hw/i2c/omap_i2c.c | 2 +- hw/i2c/smbus_eeprom.c | 2 +- hw/i386/intel_iommu.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvm/ioapic.c | 2 +- hw/i386/kvm/pci-assign.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/cmd646.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/mmio.c | 2 +- hw/ide/qdev.c | 8 ++++---- hw/input/milkymist-softusb.c | 2 +- hw/input/virtio-input-hid.c | 2 +- hw/input/virtio-input-host.c | 2 +- hw/input/virtio-input.c | 2 +- hw/input/vmmouse.c | 2 +- hw/intc/apic_common.c | 2 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/arm_gicv2m.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/exynos4210_combiner.c | 2 +- hw/intc/exynos4210_gic.c | 4 ++-- hw/intc/grlib_irqmp.c | 2 +- hw/intc/i8259_common.c | 2 +- hw/intc/ioapic.c | 2 +- hw/intc/mips_gic.c | 2 +- hw/intc/omap_intc.c | 4 ++-- hw/intc/openpic.c | 2 +- hw/intc/openpic_kvm.c | 2 +- hw/intc/xilinx_intc.c | 2 +- hw/ipack/ipack.c | 2 +- hw/ipmi/ipmi.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/isa/pc87312.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/mips/cps.c | 2 +- hw/misc/a9scu.c | 2 +- hw/misc/applesmc.c | 2 +- hw/misc/arm11scu.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/arm_sysctl.c | 2 +- hw/misc/aspeed_scu.c | 2 +- hw/misc/aspeed_sdmc.c | 2 +- hw/misc/bcm2835_property.c | 2 +- hw/misc/debugexit.c | 2 +- hw/misc/eccmemctl.c | 2 +- hw/misc/ivshmem.c | 6 +++--- hw/misc/macio/cuda.c | 2 +- hw/misc/macio/macio.c | 2 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_cpc.c | 2 +- hw/misc/mips_itu.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000e.c | 3 ++- hw/net/eepro100.c | 2 +- hw/net/etraxfs_eth.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 2 +- hw/net/lance.c | 2 +- hw/net/milkymist-minimac2.c | 2 +- hw/net/mipsnet.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/net/ne2000.c | 2 +- hw/net/opencores_eth.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/spapr_llan.c | 2 +- hw/net/stellaris_enet.c | 2 +- hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 2 +- hw/net/xgmac.c | 2 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/nvram/ds1225y.c | 2 +- hw/nvram/fw_cfg.c | 4 ++-- hw/nvram/mac_nvram.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/pci-bridge/ioh3420.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 4 ++-- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-host/piix.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/prep.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci.c | 2 +- hw/pci/pcie_port.c | 4 ++-- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 2 +- hw/ppc/spapr_rng.c | 2 +- hw/ppc/spapr_vio.c | 2 +- hw/s390x/css-bridge.c | 2 +- hw/s390x/ipl.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/virtio-ccw.c | 18 +++++++++--------- hw/scsi/megasas.c | 2 +- hw/scsi/mptsas.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/scsi/scsi-disk.c | 8 ++++---- hw/scsi/scsi-generic.c | 2 +- hw/scsi/spapr_vscsi.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/sd/sd.c | 2 +- hw/sd/sdhci.c | 4 ++-- hw/sparc/sun4m.c | 4 ++-- hw/sparc64/sun4u.c | 4 ++-- hw/ssi/aspeed_smc.c | 2 +- hw/ssi/xilinx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- hw/timer/a9gtimer.c | 2 +- hw/timer/allwinner-a10-pit.c | 2 +- hw/timer/arm_mptimer.c | 2 +- hw/timer/arm_timer.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/i8254.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/m48t59.c | 4 ++-- hw/timer/mc146818rtc.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/pxa2xx_timer.c | 4 ++-- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/xilinx_timer.c | 2 +- hw/tpm/tpm_tis.c | 2 +- hw/usb/bus.c | 2 +- hw/usb/ccid-card-emulated.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-audio.c | 2 +- hw/usb/dev-hid.c | 6 +++--- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 4 ++-- hw/usb/dev-smartcard-reader.c | 4 ++-- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ohci.c | 4 ++-- hw/usb/hcd-uhci.c | 4 ++-- hw/usb/hcd-xhci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/pci.c | 2 +- hw/vfio/platform.c | 2 +- hw/virtio/vhost-vsock.c | 2 +- hw/virtio/virtio-balloon.c | 2 +- hw/virtio/virtio-mmio.c | 2 +- hw/virtio/virtio-pci.c | 20 ++++++++++---------- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio.c | 2 +- hw/xen/xen_backend.c | 2 +- hw/xen/xen_pt.c | 2 +- include/hw/qdev-core.h | 6 ++++++ target-arm/cpu.c | 2 +- target-i386/cpu.c | 4 ++-- target-microblaze/cpu.c | 2 +- target-ppc/translate_init.c | 6 +++--- tests/test-qdev-global-props.c | 2 +- 263 files changed, 329 insertions(+), 316 deletions(-)hw/9pfs/virtio-9p-device.c +1
-1@@ -207,7 +207,7 @@ static void virtio_9p_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_9p_properties; +device_class_set_props (dc, virtio_9p_properties); dc->vmsd = &vmstate_virtio_9p;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = virtio_9p_device_realize;hw/acpi/piix4.c +1
-1@@ -687,7 +687,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_BRIDGE_OTHER ; dc->desc ="PM" ; dc->vmsd = &vmstate_acpi; - dc->props = piix4_pm_properties; +device_class_set_props (dc, piix4_pm_properties);/* * Reason: part of PIIX4 southbridge, needs to be wired up, * e.g. by mips_malta_init() hw/arm/armv7m.c +1
-1@@ -245,7 +245,7 @@ static void bitband_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = bitband_properties; +device_class_set_props (dc, bitband_properties); }static const TypeInfo bitband_info = {hw/arm/bcm2836.c +1
-1@@ -158,7 +158,7 @@ static void bcm2836_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = bcm2836_props; +device_class_set_props (dc, bcm2836_props); dc->realize = bcm2836_realize;/* hw/arm/integratorcp.c +1
-1@@ -638,7 +638,7 @@ static void core_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = core_properties; +device_class_set_props (dc, core_properties); dc->realize = integratorcm_realize; }hw/arm/musicpal.c +1
-1@@ -431,7 +431,7 @@ static void mv88w8618_eth_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &mv88w8618_eth_vmsd; - dc->props = mv88w8618_eth_properties; +device_class_set_props (dc, mv88w8618_eth_properties); dc->realize = mv88w8618_eth_realize; }hw/arm/pxa2xx.c +2
-2@@ -1530,7 +1530,7 @@ static void pxa2xx_i2c_class_init(ObjectClass *klass, void *data) dc->desc ="PXA2xx I2C Bus Controller" ; dc->vmsd = &vmstate_pxa2xx_i2c; - dc->props = pxa2xx_i2c_properties; +device_class_set_props (dc, pxa2xx_i2c_properties); }static const TypeInfo pxa2xx_i2c_info = {@@ -2013,7 +2013,7 @@ static void pxa2xx_fir_class_init(ObjectClass *klass, void *data) dc->realize = pxa2xx_fir_realize; dc->vmsd = &pxa2xx_fir_vmsd; - dc->props = pxa2xx_fir_properties; +device_class_set_props (dc, pxa2xx_fir_properties); dc->reset = pxa2xx_fir_reset; }hw/arm/pxa2xx_gpio.c +1
-1@@ -343,7 +343,7 @@ static void pxa2xx_gpio_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->desc ="PXA2xx GPIO controller" ; - dc->props = pxa2xx_gpio_properties; +device_class_set_props (dc, pxa2xx_gpio_properties); dc->vmsd = &vmstate_pxa2xx_gpio_regs; dc->realize = pxa2xx_gpio_realize; }hw/arm/spitz.c +1
-1@@ -1060,7 +1060,7 @@ static void sl_nand_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_sl_nand_info; - dc->props = sl_nand_properties; +device_class_set_props (dc, sl_nand_properties);/* Reason: init() method uses drive_get() */ dc->cannot_instantiate_with_device_add_yet = true; }hw/arm/stm32f205_soc.c +1
-1@@ -202,7 +202,7 @@ static void stm32f205_soc_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = stm32f205_soc_realize; - dc->props = stm32f205_soc_properties; +device_class_set_props (dc, stm32f205_soc_properties); }static const TypeInfo stm32f205_soc_info = {hw/arm/strongarm.c +1
-1@@ -1320,7 +1320,7 @@ static void strongarm_uart_class_init(ObjectClass *klass, void *data) dc->desc ="StrongARM UART controller" ; dc->reset = strongarm_uart_reset; dc->vmsd = &vmstate_strongarm_uart_regs; - dc->props = strongarm_uart_properties; +device_class_set_props (dc, strongarm_uart_properties); dc->realize = strongarm_uart_realize; }hw/arm/xlnx-zynqmp.c +1
-1@@ -435,7 +435,7 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = xlnx_zynqmp_props; +device_class_set_props (dc, xlnx_zynqmp_props); dc->realize = xlnx_zynqmp_realize;/* hw/audio/ac97.c +1
-1@@ -1411,7 +1411,7 @@ static void ac97_class_init (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Intel 82801AA AC97 Audio" ; dc->vmsd = &vmstate_ac97; - dc->props = ac97_properties; +device_class_set_props (dc, ac97_properties); dc->reset = ac97_on_reset; }hw/audio/adlib.c +1
-1@@ -361,7 +361,7 @@ static void adlib_class_initfn (ObjectClass *klass, void *data) dc->realize = adlib_realizefn;set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc =ADLIB_DESC ; - dc->props = adlib_properties; +device_class_set_props (dc, adlib_properties); }static const TypeInfo adlib_info = {hw/audio/cs4231.c +1
-1@@ -166,7 +166,7 @@ static void cs4231_class_init(ObjectClass *klass, void *data) dc->reset = cs_reset; dc->vmsd = &vmstate_cs4231; - dc->props = cs4231_properties; +device_class_set_props (dc, cs4231_properties); }static const TypeInfo cs4231_info = {hw/audio/cs4231a.c +1
-1@@ -695,7 +695,7 @@ static void cs4231a_class_initfn (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Crystal Semiconductor CS4231A" ; dc->vmsd = &vmstate_cs4231a; - dc->props = cs4231a_properties; +device_class_set_props (dc, cs4231a_properties); }static const TypeInfo cs4231a_info = {hw/audio/gus.c +1
-1@@ -305,7 +305,7 @@ static void gus_class_initfn (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Gravis Ultrasound GF1" ; dc->vmsd = &vmstate_gus; - dc->props = gus_properties; +device_class_set_props (dc, gus_properties); }static const TypeInfo gus_info = {hw/audio/hda-codec.c +1
-1@@ -663,7 +663,7 @@ static void hda_audio_base_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->reset = hda_audio_reset; dc->vmsd = &vmstate_hda_audio; - dc->props = hda_audio_properties; +device_class_set_props (dc, hda_audio_properties); }static const TypeInfo hda_audio_info = {hw/audio/intel-hda.c +2
-2@@ -1269,7 +1269,7 @@ static void intel_hda_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_MULTIMEDIA_HD_AUDIO ; dc->reset = intel_hda_reset; dc->vmsd = &vmstate_intel_hda; - dc->props = intel_hda_properties; +device_class_set_props (dc, intel_hda_properties); }static void intel_hda_class_init_ich6 (ObjectClass *klass,void *data)@@ -1321,7 +1321,7 @@ static void hda_codec_device_class_init(ObjectClass *klass, void *data) k->exit = hda_codec_dev_exit;set_bit (DEVICE_CATEGORY_SOUND , k->categories); k->bus_type =TYPE_HDA_BUS ; - k->props = hda_props; +device_class_set_props (k, hda_props); }static const TypeInfo hda_codec_device_type_info = {hw/audio/marvell_88w8618.c +1
-1@@ -287,7 +287,7 @@ static void mv88w8618_audio_class_init(ObjectClass *klass, void *data) k->init = mv88w8618_audio_init; dc->reset = mv88w8618_audio_reset; dc->vmsd = &mv88w8618_audio_vmsd; - dc->props = mv88w8618_audio_properties; +device_class_set_props (dc, mv88w8618_audio_properties);/* Reason: pointer property "wm8750" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/audio/pcspk.c +1
-1@@ -211,7 +211,7 @@ static void pcspk_class_initfn(ObjectClass *klass, void *data) dc->realize = pcspk_realizefn;set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->vmsd = &vmstate_spk; - dc->props = pcspk_properties; +device_class_set_props (dc, pcspk_properties);/* Reason: realize sets global pcspk_state */ dc->cannot_instantiate_with_device_add_yet = true; }hw/audio/pl041.c +1
-1@@ -633,7 +633,7 @@ static void pl041_device_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->reset = pl041_device_reset; dc->vmsd = &vmstate_pl041; - dc->props = pl041_device_properties; +device_class_set_props (dc, pl041_device_properties); }static const TypeInfo pl041_device_info = {hw/audio/sb16.c +1
-1@@ -1418,7 +1418,7 @@ static void sb16_class_initfn (ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_SOUND , dc->categories); dc->desc ="Creative Sound Blaster 16" ; dc->vmsd = &vmstate_sb16; - dc->props = sb16_properties; +device_class_set_props (dc, sb16_properties); }static const TypeInfo sb16_info = {hw/block/fdc.c +4
-4@@ -587,7 +587,7 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data) k->init = floppy_drive_init;set_bit (DEVICE_CATEGORY_STORAGE , k->categories); k->bus_type =TYPE_FLOPPY_BUS ; - k->props = floppy_drive_properties; +device_class_set_props (k, floppy_drive_properties); k->desc ="virtual floppy drive" ; }@@ -2803,7 +2803,7 @@ static void isabus_fdc_class_init(ObjectClass *klass, void *data) dc->fw_name ="fdc" ; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; - dc->props = isa_fdc_properties; +device_class_set_props (dc, isa_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }@@ -2856,7 +2856,7 @@ static void sysbus_fdc_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = sysbus_fdc_properties; +device_class_set_props (dc, sysbus_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }@@ -2882,7 +2882,7 @@ static void sun4m_fdc_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = sun4m_fdc_properties; +device_class_set_props (dc, sun4m_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }hw/block/m25p80.c +1
-1@@ -1228,7 +1228,7 @@ static void m25p80_class_init(ObjectClass *klass, void *data) k->set_cs = m25p80_cs; k->cs_polarity =SSI_CS_LOW ; dc->vmsd = &vmstate_m25p80; - dc->props = m25p80_properties; +device_class_set_props (dc, m25p80_properties); dc->reset = m25p80_reset; mc->pi = data; }hw/block/nand.c +1
-1@@ -437,7 +437,7 @@ static void nand_class_init(ObjectClass *klass, void *data) dc->realize = nand_realize; dc->reset = nand_reset; dc->vmsd = &vmstate_nand; - dc->props = nand_properties; +device_class_set_props (dc, nand_properties); }static const TypeInfo nand_info = {hw/block/nvme.c +1
-1@@ -961,7 +961,7 @@ static void nvme_class_init(ObjectClass *oc, void *data)set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->desc ="Non-Volatile Memory Express" ; - dc->props = nvme_props; +device_class_set_props (dc, nvme_props); dc->vmsd = &nvme_vmstate; }hw/block/onenand.c +1
-1@@ -838,7 +838,7 @@ static void onenand_class_init(ObjectClass *klass, void *data) k->init = onenand_initfn; dc->reset = onenand_system_reset; - dc->props = onenand_properties; +device_class_set_props (dc, onenand_properties); }static const TypeInfo onenand_info = {hw/block/pflash_cfi01.c +1
-1@@ -893,7 +893,7 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pflash_cfi01_realize; - dc->props = pflash_cfi01_properties; +device_class_set_props (dc, pflash_cfi01_properties); dc->vmsd = &vmstate_pflash;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }hw/block/pflash_cfi02.c +1
-1@@ -744,7 +744,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pflash_cfi02_realize; - dc->props = pflash_cfi02_properties; +device_class_set_props (dc, pflash_cfi02_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }hw/block/virtio-blk.c +1
-1@@ -990,7 +990,7 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_blk_properties; +device_class_set_props (dc, virtio_blk_properties); dc->vmsd = &vmstate_virtio_blk;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = virtio_blk_device_realize;hw/char/bcm2835_aux.c +1
-1@@ -294,7 +294,7 @@ static void bcm2835_aux_class_init(ObjectClass *oc, void *data) dc->realize = bcm2835_aux_realize; dc->vmsd = &vmstate_bcm2835_aux;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); - dc->props = bcm2835_aux_props; +device_class_set_props (dc, bcm2835_aux_props); }static const TypeInfo bcm2835_aux_info = {hw/char/cadence_uart.c +1
-1@@ -522,7 +522,7 @@ static void cadence_uart_class_init(ObjectClass *klass, void *data) dc->realize = cadence_uart_realize; dc->vmsd = &vmstate_cadence_uart; dc->reset = cadence_uart_reset; - dc->props = cadence_uart_properties; +device_class_set_props (dc, cadence_uart_properties); }static const TypeInfo cadence_uart_info = {hw/char/debugcon.c +1
-1@@ -125,7 +125,7 @@ static void debugcon_isa_class_initfn(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = debugcon_isa_realizefn; - dc->props = debugcon_isa_properties; +device_class_set_props (dc, debugcon_isa_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/char/digic-uart.c +1
-1@@ -181,7 +181,7 @@ static void digic_uart_class_init(ObjectClass *klass, void *data) dc->realize = digic_uart_realize; dc->reset = digic_uart_reset; dc->vmsd = &vmstate_digic_uart; - dc->props = digic_uart_properties; +device_class_set_props (dc, digic_uart_properties); }static const TypeInfo digic_uart_info = {hw/char/escc.c +1
-1@@ -1048,7 +1048,7 @@ static void escc_class_init(ObjectClass *klass, void *data) dc->reset = escc_reset; dc->realize = escc_realize; dc->vmsd = &vmstate_escc; - dc->props = escc_properties; +device_class_set_props (dc, escc_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }hw/char/etraxfs_ser.c +1
-1@@ -241,7 +241,7 @@ static void etraxfs_ser_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = etraxfs_ser_reset; - dc->props = etraxfs_ser_properties; +device_class_set_props (dc, etraxfs_ser_properties); dc->realize = etraxfs_ser_realize; }hw/char/exynos4210_uart.c +1
-1@@ -662,7 +662,7 @@ static void exynos4210_uart_class_init(ObjectClass *klass, void *data) k->init = exynos4210_uart_init; dc->reset = exynos4210_uart_reset; - dc->props = exynos4210_uart_properties; +device_class_set_props (dc, exynos4210_uart_properties); dc->vmsd = &vmstate_exynos4210_uart; }hw/char/grlib_apbuart.c +1
-1@@ -284,7 +284,7 @@ static void grlib_apbuart_class_init(ObjectClass *klass, void *data) k->init = grlib_apbuart_init; dc->reset = grlib_apbuart_reset; - dc->props = grlib_apbuart_properties; +device_class_set_props (dc, grlib_apbuart_properties); }static const TypeInfo grlib_apbuart_info = {hw/char/imx_serial.c +1
-1@@ -344,7 +344,7 @@ static void imx_serial_class_init(ObjectClass *klass, void *data) dc->reset = imx_serial_reset_at_boot;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="i.MX series UART" ; - dc->props = imx_serial_properties; +device_class_set_props (dc, imx_serial_properties); }static const TypeInfo imx_serial_info = {hw/char/ipoctal232.c +1
-1@@ -584,7 +584,7 @@ static void ipoctal_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="GE IP-Octal 232 8-channel RS-232 IndustryPack" ; - dc->props = ipoctal_properties; +device_class_set_props (dc, ipoctal_properties); dc->vmsd = &vmstate_ipoctal; }hw/char/lm32_juart.c +1
-1@@ -144,7 +144,7 @@ static void lm32_juart_class_init(ObjectClass *klass, void *data) dc->reset = juart_reset; dc->vmsd = &vmstate_lm32_juart; - dc->props = lm32_juart_properties; +device_class_set_props (dc, lm32_juart_properties); dc->realize = lm32_juart_realize; }hw/char/lm32_uart.c +1
-1@@ -290,7 +290,7 @@ static void lm32_uart_class_init(ObjectClass *klass, void *data) dc->reset = uart_reset; dc->vmsd = &vmstate_lm32_uart; - dc->props = lm32_uart_properties; +device_class_set_props (dc, lm32_uart_properties); dc->realize = lm32_uart_realize; }hw/char/milkymist-uart.c +1
-1@@ -236,7 +236,7 @@ static void milkymist_uart_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_uart_realize; dc->reset = milkymist_uart_reset; dc->vmsd = &vmstate_milkymist_uart; - dc->props = milkymist_uart_properties; +device_class_set_props (dc, milkymist_uart_properties); }static const TypeInfo milkymist_uart_info = {hw/char/parallel.c +1
-1@@ -633,7 +633,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = parallel_isa_realizefn; dc->vmsd = &vmstate_parallel_isa; - dc->props = parallel_isa_properties; +device_class_set_props (dc, parallel_isa_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }hw/char/pl011.c +1
-1@@ -338,7 +338,7 @@ static void pl011_class_init(ObjectClass *oc, void *data) dc->realize = pl011_realize; dc->vmsd = &vmstate_pl011; - dc->props = pl011_properties; +device_class_set_props (dc, pl011_properties); }static const TypeInfo pl011_arm_info = {hw/char/sclpconsole-lm.c +1
-1@@ -345,7 +345,7 @@ static void console_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);SCLPEventClass *ec =SCLP_EVENT_CLASS (klass); - dc->props = console_properties; +device_class_set_props (dc, console_properties); dc->reset = console_reset; dc->vmsd = &vmstate_sclplmconsole; ec->init = console_init;hw/char/sclpconsole.c +1
-1@@ -261,7 +261,7 @@ static void console_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);SCLPEventClass *ec =SCLP_EVENT_CLASS (klass); - dc->props = console_properties; +device_class_set_props (dc, console_properties); dc->reset = console_reset; dc->vmsd = &vmstate_sclpconsole; ec->init = console_init;hw/char/serial-isa.c +1
-1@@ -103,7 +103,7 @@ static void serial_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = serial_isa_realizefn; dc->vmsd = &vmstate_isa_serial; - dc->props = serial_isa_properties; +device_class_set_props (dc, serial_isa_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }hw/char/serial-pci.c +3
-3@@ -211,7 +211,7 @@ static void serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision =1 ; pc->class_id =PCI_CLASS_COMMUNICATION_SERIAL ; dc->vmsd = &vmstate_pci_serial; - dc->props = serial_pci_properties; +device_class_set_props (dc, serial_pci_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }@@ -226,7 +226,7 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision =1 ; pc->class_id =PCI_CLASS_COMMUNICATION_SERIAL ; dc->vmsd = &vmstate_pci_multi_serial; - dc->props = multi_2x_serial_pci_properties; +device_class_set_props (dc, multi_2x_serial_pci_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }@@ -241,7 +241,7 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision =1 ; pc->class_id =PCI_CLASS_COMMUNICATION_SERIAL ; dc->vmsd = &vmstate_pci_multi_serial; - dc->props = multi_4x_serial_pci_properties; +device_class_set_props (dc, multi_4x_serial_pci_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }hw/char/spapr_vty.c +1
-1@@ -171,7 +171,7 @@ static void spapr_vty_class_init(ObjectClass *klass, void *data) k->dt_type ="serial" ; k->dt_compatible ="hvterm1" ;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); - dc->props = spapr_vty_properties; +device_class_set_props (dc, spapr_vty_properties); dc->vmsd = &vmstate_spapr_vty; }hw/char/stm32f2xx_usart.c +1
-1@@ -215,7 +215,7 @@ static void stm32f2xx_usart_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = stm32f2xx_usart_reset; - dc->props = stm32f2xx_usart_properties; +device_class_set_props (dc, stm32f2xx_usart_properties); dc->realize = stm32f2xx_usart_realize; }hw/char/virtio-console.c +1
-1@@ -234,7 +234,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data) k->have_data = flush_buf; k->set_guest_connected = set_guest_connected; k->guest_writable = guest_writable; - dc->props = virtserialport_properties; +device_class_set_props (dc, virtserialport_properties); }static const TypeInfo virtserialport_info = {hw/char/virtio-serial-bus.c +2
-2@@ -1091,7 +1091,7 @@ static void virtio_serial_port_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_VIRTIO_SERIAL_BUS ; k->realize = virtser_port_device_realize; k->unrealize = virtser_port_device_unrealize; - k->props = virtser_props; +device_class_set_props (k, virtser_props); }static const TypeInfo virtio_serial_port_type_info = {@@ -1149,7 +1149,7 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data)QLIST_INIT (&vserdevices.devices); - dc->props = virtio_serial_properties; +device_class_set_props (dc, virtio_serial_properties); dc->vmsd = &vmstate_virtio_console;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); vdc->realize = virtio_serial_device_realize;hw/char/xilinx_uartlite.c +1
-1@@ -232,7 +232,7 @@ static void xilinx_uartlite_class_init(ObjectClass *klass, void *data) dc->reset = xilinx_uartlite_reset; dc->realize = xilinx_uartlite_realize; - dc->props = xilinx_uartlite_properties; +device_class_set_props (dc, xilinx_uartlite_properties); }static const TypeInfo xilinx_uartlite_info = {hw/core/generic-loader.c +1
-1@@ -192,7 +192,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data)*/ dc->realize = generic_loader_realize; dc->unrealize = generic_loader_unrealize; - dc->props = generic_loader_props; +device_class_set_props (dc, generic_loader_props); dc->desc ="Generic Loader" ; }hw/core/or-irq.c +1
-1@@ -86,7 +86,7 @@ static void or_irq_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = or_irq_reset; - dc->props = or_irq_properties; +device_class_set_props (dc, or_irq_properties); dc->realize = or_irq_realize; dc->vmsd = &vmstate_or_irq; }hw/core/platform-bus.c +1
-1@@ -230,7 +230,7 @@ static void platform_bus_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = platform_bus_realize; - dc->props = platform_bus_properties; +device_class_set_props (dc, platform_bus_properties); }static const TypeInfo platform_bus_info = {hw/core/qdev.c +6
-0@@ -848,6 +848,12 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) }while (class !=object_class_by_name (TYPE_DEVICE )); } +void device_class_set_props (DeviceClass *dc,Property *props) +{ +assert (!dc->props); + dc->props = props; +} +static int qdev_add_hotpluggable_device (Object *obj,void *opaque) {GSList **list = opaque;hw/cpu/a15mpcore.c +1
-1@@ -138,7 +138,7 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = a15mp_priv_realize; - dc->props = a15mp_priv_properties; +device_class_set_props (dc, a15mp_priv_properties);/* We currently have no savable state */ }hw/cpu/a9mpcore.c +1
-1@@ -174,7 +174,7 @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = a9mp_priv_realize; - dc->props = a9mp_priv_properties; +device_class_set_props (dc, a9mp_priv_properties); }static const TypeInfo a9mp_priv_info = {hw/cpu/arm11mpcore.c +1
-1@@ -155,7 +155,7 @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = mpcore_priv_realize; - dc->props = mpcore_priv_properties; +device_class_set_props (dc, mpcore_priv_properties); }static const TypeInfo mpcore_priv_info = {hw/cpu/realview_mpcore.c +1
-1@@ -122,7 +122,7 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = realview_mpcore_realize; - dc->props = mpcore_rirq_properties; +device_class_set_props (dc, mpcore_rirq_properties); }static const TypeInfo mpcore_rirq_info = {hw/display/bcm2835_fb.c +1
-1@@ -404,7 +404,7 @@ static void bcm2835_fb_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = bcm2835_fb_props; +device_class_set_props (dc, bcm2835_fb_props); dc->realize = bcm2835_fb_realize; dc->reset = bcm2835_fb_reset; dc->vmsd = &vmstate_bcm2835_fb;hw/display/cg3.c +1
-1@@ -382,7 +382,7 @@ static void cg3_class_init(ObjectClass *klass, void *data) dc->realize = cg3_realizefn; dc->reset = cg3_reset; dc->vmsd = &vmstate_cg3; - dc->props = cg3_properties; +device_class_set_props (dc, cg3_properties); }static const TypeInfo cg3_info = {hw/display/cirrus_vga.c +2
-2@@ -2995,7 +2995,7 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_cirrus_vga; dc->realize = isa_cirrus_vga_realizefn; - dc->props = isa_cirrus_vga_properties; +device_class_set_props (dc, isa_cirrus_vga_properties);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); }@@ -3071,7 +3071,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); dc->desc ="Cirrus CLGD 54xx VGA" ; dc->vmsd = &vmstate_pci_cirrus_vga; - dc->props = pci_vga_cirrus_properties; +device_class_set_props (dc, pci_vga_cirrus_properties); dc->hotpluggable = false; }hw/display/g364fb.c +1
-1@@ -541,7 +541,7 @@ static void g364fb_sysbus_class_init(ObjectClass *klass, void *data) dc->desc ="G364 framebuffer" ; dc->reset = g364fb_sysbus_reset; dc->vmsd = &vmstate_g364fb; - dc->props = g364fb_sysbus_properties; +device_class_set_props (dc, g364fb_sysbus_properties); }static const TypeInfo g364fb_sysbus_info = {hw/display/milkymist-vgafb.c +1
-1@@ -338,7 +338,7 @@ static void milkymist_vgafb_class_init(ObjectClass *klass, void *data) dc->reset = milkymist_vgafb_reset; dc->vmsd = &vmstate_milkymist_vgafb; - dc->props = milkymist_vgafb_properties; +device_class_set_props (dc, milkymist_vgafb_properties); dc->realize = milkymist_vgafb_realize; }hw/display/qxl.c +1
-1@@ -2339,7 +2339,7 @@ static void qxl_pci_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); dc->reset = qxl_reset_handler; dc->vmsd = &qxl_vmstate; - dc->props = qxl_properties; +device_class_set_props (dc, qxl_properties); }static const TypeInfo qxl_pci_type_info = {hw/display/tcx.c +1
-1@@ -1087,7 +1087,7 @@ static void tcx_class_init(ObjectClass *klass, void *data) dc->realize = tcx_realizefn; dc->reset = tcx_reset; dc->vmsd = &vmstate_tcx; - dc->props = tcx_properties; +device_class_set_props (dc, tcx_properties); }static const TypeInfo tcx_info = {hw/display/vga-isa.c +1
-1@@ -91,7 +91,7 @@ static void vga_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = vga_isa_realizefn; dc->reset = vga_isa_reset; dc->vmsd = &vmstate_vga_common; - dc->props = vga_isa_properties; +device_class_set_props (dc, vga_isa_properties);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); }hw/display/vga-pci.c +2
-2@@ -348,7 +348,7 @@ static void vga_class_init(ObjectClass *klass, void *data) k->realize = pci_std_vga_realize; k->romfile ="vgabios-stdvga.bin" ; k->class_id =PCI_CLASS_DISPLAY_VGA ; - dc->props = vga_pci_properties; +device_class_set_props (dc, vga_pci_properties); dc->hotpluggable = false; }@@ -359,7 +359,7 @@ static void secondary_class_init(ObjectClass *klass, void *data) k->realize = pci_secondary_vga_realize; k->class_id =PCI_CLASS_DISPLAY_OTHER ; - dc->props = secondary_pci_properties; +device_class_set_props (dc, secondary_pci_properties); dc->reset = pci_secondary_vga_reset; }hw/display/virtio-gpu-pci.c +1
-1@@ -47,7 +47,7 @@ static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); - dc->props = virtio_gpu_pci_properties; +device_class_set_props (dc, virtio_gpu_pci_properties); dc->hotpluggable = false; k->realize = virtio_gpu_pci_realize; pcidev_k->class_id =PCI_CLASS_DISPLAY_OTHER ;hw/display/virtio-gpu.c +1
-1@@ -1263,7 +1263,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data) vdc->reset = virtio_gpu_reset; - dc->props = virtio_gpu_properties; +device_class_set_props (dc, virtio_gpu_properties); dc->vmsd = &vmstate_virtio_gpu; }hw/display/virtio-vga.c +1
-1@@ -186,7 +186,7 @@ static void virtio_vga_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); - dc->props = virtio_vga_properties; +device_class_set_props (dc, virtio_vga_properties); dc->reset = virtio_vga_reset; dc->vmsd = &vmstate_virtio_vga; dc->hotpluggable = false;hw/display/vmware_vga.c +1
-1@@ -1356,7 +1356,7 @@ static void vmsvga_class_init(ObjectClass *klass, void *data) k->subsystem_id =SVGA_PCI_DEVICE_ID ; dc->reset = vmsvga_reset; dc->vmsd = &vmstate_vmware_vga; - dc->props = vga_vmware_properties; +device_class_set_props (dc, vga_vmware_properties); dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); }hw/dma/i82374.c +1
-1@@ -138,7 +138,7 @@ static void i82374_class_init(ObjectClass *klass, void *data) dc->realize = i82374_realize; dc->vmsd = &vmstate_i82374; - dc->props = i82374_properties; +device_class_set_props (dc, i82374_properties); }static const TypeInfo i82374_info = {hw/dma/i8257.c +1
-1@@ -590,7 +590,7 @@ static void i8257_class_init(ObjectClass *klass, void *data) dc->realize = i8257_realize; dc->reset = i8257_reset; dc->vmsd = &vmstate_i8257; - dc->props = i8257_properties; +device_class_set_props (dc, i8257_properties); idc->get_transfer_mode = i8257_dma_get_transfer_mode; idc->has_autoinitialization = i8257_dma_has_autoinitialization;hw/dma/pl330.c +1
-1@@ -1650,7 +1650,7 @@ static void pl330_class_init(ObjectClass *klass, void *data) dc->realize = pl330_realize; dc->reset = pl330_reset; - dc->props = pl330_properties; +device_class_set_props (dc, pl330_properties); dc->vmsd = &vmstate_pl330; }hw/dma/pxa2xx_dma.c +1
-1@@ -562,7 +562,7 @@ static void pxa2xx_dma_class_init(ObjectClass *klass, void *data) dc->desc ="PXA2xx DMA controller" ; dc->vmsd = &vmstate_pxa2xx_dma; - dc->props = pxa2xx_dma_properties; +device_class_set_props (dc, pxa2xx_dma_properties); dc->realize = pxa2xx_dma_realize; }hw/dma/sparc32_dma.c +1
-1@@ -303,7 +303,7 @@ static void sparc32_dma_class_init(ObjectClass *klass, void *data) k->init = sparc32_dma_init1; dc->reset = dma_reset; dc->vmsd = &vmstate_dma; - dc->props = sparc32_dma_properties; +device_class_set_props (dc, sparc32_dma_properties);/* Reason: pointer property "iommu_opaque" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/dma/sun4m_iommu.c +1
-1@@ -375,7 +375,7 @@ static void iommu_class_init(ObjectClass *klass, void *data) k->init = iommu_init1; dc->reset = iommu_reset; dc->vmsd = &vmstate_iommu; - dc->props = iommu_properties; +device_class_set_props (dc, iommu_properties); }static const TypeInfo iommu_info = {hw/dma/xilinx_axidma.c +1
-1@@ -604,7 +604,7 @@ static void axidma_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_axidma_realize, dc->reset = xilinx_axidma_reset; - dc->props = axidma_properties; +device_class_set_props (dc, axidma_properties); }static StreamSlaveClass xilinx_axidma_data_stream_class = {hw/gpio/imx_gpio.c +1
-1@@ -331,7 +331,7 @@ static void imx_gpio_class_init(ObjectClass *klass, void *data) dc->realize = imx_gpio_realize; dc->reset = imx_gpio_reset; - dc->props = imx_gpio_properties; +device_class_set_props (dc, imx_gpio_properties); dc->vmsd = &vmstate_imx_gpio; dc->desc ="i.MX GPIO controller" ; }hw/gpio/omap_gpio.c +2
-2@@ -771,7 +771,7 @@ static void omap_gpio_class_init(ObjectClass *klass, void *data) dc->realize = omap_gpio_realize; dc->reset = omap_gpif_reset; - dc->props = omap_gpio_properties; +device_class_set_props (dc, omap_gpio_properties);/* Reason: pointer property "clk" */ dc->cannot_instantiate_with_device_add_yet = true; }@@ -802,7 +802,7 @@ static void omap2_gpio_class_init(ObjectClass *klass, void *data) dc->realize = omap2_gpio_realize; dc->reset = omap2_gpif_reset; - dc->props = omap2_gpio_properties; +device_class_set_props (dc, omap2_gpio_properties);/* Reason: pointer properties "iclk", "fclk0", ..., "fclk5" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/i2c/core.c +1
-1@@ -279,7 +279,7 @@ static void i2c_slave_class_init(ObjectClass *klass, void *data) k->init = i2c_slave_qdev_init;set_bit (DEVICE_CATEGORY_MISC , k->categories); k->bus_type =TYPE_I2C_BUS ; - k->props = i2c_props; +device_class_set_props (k, i2c_props); }static const TypeInfo i2c_slave_type_info = {hw/i2c/omap_i2c.c +1
-1@@ -488,7 +488,7 @@ static void omap_i2c_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = omap_i2c_properties; +device_class_set_props (dc, omap_i2c_properties); dc->reset = omap_i2c_reset;/* Reason: pointer properties "iclk", "fclk" */ dc->cannot_instantiate_with_device_add_yet = true;hw/i2c/smbus_eeprom.c +1
-1@@ -121,7 +121,7 @@ static void smbus_eeprom_class_initfn(ObjectClass *klass, void *data) sc->receive_byte = eeprom_receive_byte; sc->write_data = eeprom_write_data; sc->read_data = eeprom_read_data; - dc->props = smbus_eeprom_properties; +device_class_set_props (dc, smbus_eeprom_properties);/* Reason: pointer property "data" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/i386/intel_iommu.c +1
-1@@ -2542,7 +2542,7 @@ static void vtd_class_init(ObjectClass *klass, void *data) dc->reset = vtd_reset; dc->vmsd = &vtd_vmstate; - dc->props = vtd_properties; +device_class_set_props (dc, vtd_properties); dc->hotpluggable = false; x86_class->realize = vtd_realize; x86_class->int_remap = vtd_int_remap;hw/i386/kvm/i8254.c +1
-1@@ -320,7 +320,7 @@ static void kvm_pit_class_init(ObjectClass *klass, void *data) k->set_channel_gate = kvm_pit_set_gate; k->get_channel_info = kvm_pit_get_channel_info; dc->reset = kvm_pit_reset; - dc->props = kvm_pit_properties; +device_class_set_props (dc, kvm_pit_properties); }static const TypeInfo kvm_pit_info = {hw/i386/kvm/ioapic.c +1
-1@@ -161,7 +161,7 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data) k->pre_save = kvm_ioapic_get; k->post_load = kvm_ioapic_put; dc->reset = kvm_ioapic_reset; - dc->props = kvm_ioapic_properties; +device_class_set_props (dc, kvm_ioapic_properties); }static const TypeInfo kvm_ioapic_info = {hw/i386/kvm/pci-assign.c +1
-1@@ -1861,7 +1861,7 @@ static void assign_class_init(ObjectClass *klass, void *data) k->exit = assigned_exitfn; k->config_read = assigned_dev_pci_read_config; k->config_write = assigned_dev_pci_write_config; - dc->props = assigned_dev_properties; +device_class_set_props (dc, assigned_dev_properties); dc->vmsd = &vmstate_assigned_device; dc->reset = reset_assigned_device;set_bit (DEVICE_CATEGORY_MISC , dc->categories);hw/i386/xen/xen_pvdevice.c +1
-1@@ -119,7 +119,7 @@ static void xen_pv_class_init(ObjectClass *klass, void *data) k->realize = xen_pv_realize; k->class_id =PCI_CLASS_SYSTEM_OTHER ; dc->desc ="Xen PV Device" ; - dc->props = xen_pv_props; +device_class_set_props (dc, xen_pv_props); }static const TypeInfo xen_pv_type_info = {hw/ide/ahci.c +1
-1@@ -1706,7 +1706,7 @@ static void sysbus_ahci_class_init(ObjectClass *klass, void *data) dc->realize = sysbus_ahci_realize; dc->vmsd = &vmstate_sysbus_ahci; - dc->props = sysbus_ahci_properties; +device_class_set_props (dc, sysbus_ahci_properties); dc->reset = sysbus_ahci_reset;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }hw/ide/cmd646.c +1
-1@@ -417,7 +417,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_STORAGE_IDE ; k->config_read = cmd646_pci_config_read; k->config_write = cmd646_pci_config_write; - dc->props = cmd646_ide_properties; +device_class_set_props (dc, cmd646_ide_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }hw/ide/isa.c +1
-1@@ -116,7 +116,7 @@ static void isa_ide_class_initfn(ObjectClass *klass, void *data) dc->realize = isa_ide_realizefn; dc->fw_name ="ide" ; dc->reset = isa_ide_reset; - dc->props = isa_ide_properties; +device_class_set_props (dc, isa_ide_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }hw/ide/mmio.c +1
-1@@ -152,7 +152,7 @@ static void mmio_ide_class_init(ObjectClass *oc, void *data) dc->realize = mmio_ide_realizefn; dc->reset = mmio_ide_reset; - dc->props = mmio_ide_properties; +device_class_set_props (dc, mmio_ide_properties); dc->vmsd = &vmstate_ide_mmio; }hw/ide/qdev.c +4
-4@@ -305,7 +305,7 @@ static void ide_hd_class_init(ObjectClass *klass, void *data) k->init = ide_hd_initfn; dc->fw_name ="drive" ; dc->desc ="virtual IDE disk" ; - dc->props = ide_hd_properties; +device_class_set_props (dc, ide_hd_properties); }static const TypeInfo ide_hd_info = {@@ -327,7 +327,7 @@ static void ide_cd_class_init(ObjectClass *klass, void *data) k->init = ide_cd_initfn; dc->fw_name ="drive" ; dc->desc ="virtual IDE CD-ROM" ; - dc->props = ide_cd_properties; +device_class_set_props (dc, ide_cd_properties); }static const TypeInfo ide_cd_info = {@@ -349,7 +349,7 @@ static void ide_drive_class_init(ObjectClass *klass, void *data) k->init = ide_drive_initfn; dc->fw_name ="drive" ; dc->desc ="virtual IDE disk or CD-ROM (legacy)" ; - dc->props = ide_drive_properties; +device_class_set_props (dc, ide_drive_properties); }static const TypeInfo ide_drive_info = {@@ -366,7 +366,7 @@ static void ide_device_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_STORAGE , k->categories); k->bus_type =TYPE_IDE_BUS ; k->unrealize = idebus_unrealize; - k->props = ide_props; +device_class_set_props (k, ide_props); }static const TypeInfo ide_device_type_info = {hw/input/milkymist-softusb.c +1
-1@@ -301,7 +301,7 @@ static void milkymist_softusb_class_init(ObjectClass *klass, void *data) k->init = milkymist_softusb_init; dc->reset = milkymist_softusb_reset; dc->vmsd = &vmstate_milkymist_softusb; - dc->props = milkymist_softusb_properties; +device_class_set_props (dc, milkymist_softusb_properties); }static const TypeInfo milkymist_softusb_info = {hw/input/virtio-input-hid.c +1
-1@@ -327,7 +327,7 @@ static void virtio_input_hid_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtIOInputClass *vic =VIRTIO_INPUT_CLASS (klass); - dc->props = virtio_input_hid_properties; +device_class_set_props (dc, virtio_input_hid_properties); vic->realize = virtio_input_hid_realize; vic->unrealize = virtio_input_hid_unrealize; vic->change_active = virtio_input_hid_change_active;hw/input/virtio-input-host.c +1
-1@@ -226,7 +226,7 @@ static void virtio_input_host_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_virtio_input_host; - dc->props = virtio_input_host_properties; +device_class_set_props (dc, virtio_input_host_properties); vic->realize = virtio_input_host_realize; vic->unrealize = virtio_input_host_unrealize; vic->handle_status = virtio_input_host_handle_status;hw/input/virtio-input.c +1
-1@@ -310,7 +310,7 @@ static void virtio_input_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_input_properties; +device_class_set_props (dc, virtio_input_properties); dc->vmsd = &vmstate_virtio_input;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); vdc->realize = virtio_input_device_realize;hw/input/vmmouse.c +1
-1@@ -284,7 +284,7 @@ static void vmmouse_class_initfn(ObjectClass *klass, void *data) dc->realize = vmmouse_realizefn; dc->reset = vmmouse_reset; dc->vmsd = &vmstate_vmmouse; - dc->props = vmmouse_properties; +device_class_set_props (dc, vmmouse_properties);/* Reason: pointer property "ps2_mouse" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/intc/apic_common.c +1
-1@@ -491,7 +491,7 @@ static void apic_common_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = apic_reset_common; - dc->props = apic_properties_common; +device_class_set_props (dc, apic_properties_common); dc->realize = apic_common_realize; dc->unrealize = apic_common_unrealize;/* hw/intc/arm_gic_common.c +1
-1@@ -264,7 +264,7 @@ static void arm_gic_common_class_init(ObjectClass *klass, void *data) dc->reset = arm_gic_common_reset; dc->realize = arm_gic_common_realize; - dc->props = arm_gic_common_properties; +device_class_set_props (dc, arm_gic_common_properties); dc->vmsd = &vmstate_gic; albifc->arm_linux_init = arm_gic_common_linux_init; }hw/intc/arm_gicv2m.c +1
-1@@ -176,7 +176,7 @@ static void gicv2m_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = gicv2m_properties; +device_class_set_props (dc, gicv2m_properties); dc->realize = gicv2m_realize; }hw/intc/arm_gicv3_common.c +1
-1@@ -325,7 +325,7 @@ static void arm_gicv3_common_class_init(ObjectClass *klass, void *data) dc->reset = arm_gicv3_common_reset; dc->realize = arm_gicv3_common_realize; - dc->props = arm_gicv3_common_properties; +device_class_set_props (dc, arm_gicv3_common_properties); dc->vmsd = &vmstate_gicv3; albifc->arm_linux_init = arm_gic_common_linux_init; }hw/intc/etraxfs_pic.c +1
-1@@ -170,7 +170,7 @@ static void etraxfs_pic_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = etraxfs_pic_properties; +device_class_set_props (dc, etraxfs_pic_properties);/* * Note: pointer property "interrupt_vector" may remain null, thus * no need for dc->cannot_instantiate_with_device_add_yet = true; hw/intc/exynos4210_combiner.c +1
-1@@ -437,7 +437,7 @@ static void exynos4210_combiner_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = exynos4210_combiner_reset; - dc->props = exynos4210_combiner_properties; +device_class_set_props (dc, exynos4210_combiner_properties); dc->vmsd = &vmstate_exynos4210_combiner; }hw/intc/exynos4210_gic.c +2
-2@@ -346,7 +346,7 @@ static void exynos4210_gic_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = exynos4210_gic_properties; +device_class_set_props (dc, exynos4210_gic_properties); }static const TypeInfo exynos4210_gic_info = {@@ -453,7 +453,7 @@ static void exynos4210_irq_gate_class_init(ObjectClass *klass, void *data) dc->reset = exynos4210_irq_gate_reset; dc->vmsd = &vmstate_exynos4210_irq_gate; - dc->props = exynos4210_irq_gate_properties; +device_class_set_props (dc, exynos4210_irq_gate_properties); dc->realize = exynos4210_irq_gate_realize; }hw/intc/grlib_irqmp.c +1
-1@@ -358,7 +358,7 @@ static void grlib_irqmp_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = grlib_irqmp_reset; - dc->props = grlib_irqmp_properties; +device_class_set_props (dc, grlib_irqmp_properties);/* Reason: pointer properties "set_pil_in", "set_pil_in_opaque" */ dc->cannot_instantiate_with_device_add_yet = true; dc->realize = grlib_irqmp_realize;hw/intc/i8259_common.c +1
-1@@ -136,7 +136,7 @@ static void pic_common_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_pic_common; - dc->props = pic_properties_common; +device_class_set_props (dc, pic_properties_common); dc->realize = pic_common_realize;/* * Reason: unlike ordinary ISA devices, the PICs need additional hw/intc/ioapic.c +1
-1@@ -427,7 +427,7 @@ static void ioapic_class_init(ObjectClass *klass, void *data) k->realize = ioapic_realize; dc->reset = ioapic_reset_common; - dc->props = ioapic_properties; +device_class_set_props (dc, ioapic_properties); }static const TypeInfo ioapic_info = {hw/intc/mips_gic.c +1
-1@@ -440,7 +440,7 @@ static void mips_gic_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = mips_gic_properties; +device_class_set_props (dc, mips_gic_properties); dc->realize = mips_gic_realize; }hw/intc/omap_intc.c +2
-2@@ -399,7 +399,7 @@ static void omap_intc_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = omap_inth_reset; - dc->props = omap_intc_properties; +device_class_set_props (dc, omap_intc_properties);/* Reason: pointer property "clk" */ dc->cannot_instantiate_with_device_add_yet = true; dc->realize = omap_intc_realize;@@ -654,7 +654,7 @@ static void omap2_intc_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = omap_inth_reset; - dc->props = omap2_intc_properties; +device_class_set_props (dc, omap2_intc_properties);/* Reason: pointer property "iclk", "fclk" */ dc->cannot_instantiate_with_device_add_yet = true; dc->realize = omap2_intc_realize;hw/intc/openpic.c +1
-1@@ -1643,7 +1643,7 @@ static void openpic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = openpic_realize; - dc->props = openpic_properties; +device_class_set_props (dc, openpic_properties); dc->reset = openpic_reset; dc->vmsd = &vmstate_openpic;set_bit (DEVICE_CATEGORY_MISC , dc->categories);hw/intc/openpic_kvm.c +1
-1@@ -277,7 +277,7 @@ static void kvm_openpic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = kvm_openpic_realize; - dc->props = kvm_openpic_properties; +device_class_set_props (dc, kvm_openpic_properties); dc->reset = kvm_openpic_reset;set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/intc/xilinx_intc.c +1
-1@@ -183,7 +183,7 @@ static void xilinx_intc_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = xilinx_intc_properties; +device_class_set_props (dc, xilinx_intc_properties); }static const TypeInfo xilinx_intc_info = {hw/ipack/ipack.c +1
-1@@ -84,7 +84,7 @@ static void ipack_device_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_IPACK_BUS ; k->realize = ipack_device_realize; k->unrealize = ipack_device_unrealize; - k->props = ipack_device_props; +device_class_set_props (k, ipack_device_props); }const VMStateDescription vmstate_ipack_device = {hw/ipmi/ipmi.c +1
-1@@ -110,7 +110,7 @@ static void bmc_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = ipmi_bmc_properties; +device_class_set_props (dc, ipmi_bmc_properties); }static TypeInfo ipmi_bmc_type_info = {hw/ipmi/ipmi_bmc_extern.c +1
-1@@ -513,7 +513,7 @@ static void ipmi_bmc_extern_class_init(ObjectClass *oc, void *data) bk->handle_command = ipmi_bmc_extern_handle_command; bk->handle_reset = ipmi_bmc_extern_handle_reset; dc->realize = ipmi_bmc_extern_realize; - dc->props = ipmi_bmc_extern_properties; +device_class_set_props (dc, ipmi_bmc_extern_properties); }static const TypeInfo ipmi_bmc_extern_type = {hw/ipmi/isa_ipmi_bt.c +1
-1@@ -511,7 +511,7 @@ static void isa_ipmi_bt_class_init(ObjectClass *oc, void *data)IPMIInterfaceClass *iic =IPMI_INTERFACE_CLASS (oc); dc->realize = isa_ipmi_bt_realize; - dc->props = ipmi_isa_properties; +device_class_set_props (dc, ipmi_isa_properties); iic->get_backend_data = isa_ipmi_bt_get_backend_data;ipmi_bt_class_init (iic);hw/ipmi/isa_ipmi_kcs.c +1
-1@@ -475,7 +475,7 @@ static void isa_ipmi_kcs_class_init(ObjectClass *oc, void *data)IPMIInterfaceClass *iic =IPMI_INTERFACE_CLASS (oc); dc->realize = ipmi_isa_realize; - dc->props = ipmi_isa_properties; +device_class_set_props (dc, ipmi_isa_properties); iic->get_backend_data = isa_ipmi_kcs_get_backend_data;ipmi_kcs_class_init (iic);hw/isa/lpc_ich9.c +1
-1@@ -710,7 +710,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data) dc->reset = ich9_lpc_reset; k->realize = ich9_lpc_realize; dc->vmsd = &vmstate_ich9_lpc; - dc->props = ich9_lpc_properties; +device_class_set_props (dc, ich9_lpc_properties); k->config_write = ich9_lpc_config_write; dc->desc ="ICH9 LPC bridge" ; k->vendor_id =PCI_VENDOR_ID_INTEL ;hw/isa/pc87312.c +1
-1@@ -385,7 +385,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data) dc->realize = pc87312_realize; dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; - dc->props = pc87312_properties; +device_class_set_props (dc, pc87312_properties); }static const TypeInfo pc87312_type_info = {hw/isa/vt82c686.c +1
-1@@ -411,7 +411,7 @@ static void via_pm_class_init(ObjectClass *klass, void *data) dc->desc ="PM" ; dc->vmsd = &vmstate_acpi;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); - dc->props = via_pm_properties; +device_class_set_props (dc, via_pm_properties); }static const TypeInfo via_pm_info = {hw/mem/pc-dimm.c +1
-1@@ -443,7 +443,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data) dc->realize = pc_dimm_realize; dc->unrealize = pc_dimm_unrealize; - dc->props = pc_dimm_properties; +device_class_set_props (dc, pc_dimm_properties); dc->desc ="DIMM memory module" ; ddc->get_memory_region = pc_dimm_get_memory_region;hw/mips/cps.c +1
-1@@ -173,7 +173,7 @@ static void mips_cps_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = mips_cps_realize; - dc->props = mips_cps_properties; +device_class_set_props (dc, mips_cps_properties); }static const TypeInfo mips_cps_info = {hw/misc/a9scu.c +1
-1@@ -132,7 +132,7 @@ static void a9_scu_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = a9_scu_properties; +device_class_set_props (dc, a9_scu_properties); dc->vmsd = &vmstate_a9_scu; dc->reset = a9_scu_reset; }hw/misc/applesmc.c +1
-1@@ -261,7 +261,7 @@ static void qdev_applesmc_class_init(ObjectClass *klass, void *data) dc->realize = applesmc_isa_realize; dc->reset = qdev_applesmc_isa_reset; - dc->props = applesmc_isa_properties; +device_class_set_props (dc, applesmc_isa_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/misc/arm11scu.c +1
-1@@ -83,7 +83,7 @@ static void arm11_scu_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = arm11_scu_realize; - dc->props = arm11_scu_properties; +device_class_set_props (dc, arm11_scu_properties); }static const TypeInfo arm11_scu_type_info = {hw/misc/arm_l2x0.c +1
-1@@ -179,7 +179,7 @@ static void l2x0_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_l2x0; - dc->props = l2x0_properties; +device_class_set_props (dc, l2x0_properties); dc->reset = l2x0_priv_reset; }hw/misc/arm_sysctl.c +1
-1@@ -639,7 +639,7 @@ static void arm_sysctl_class_init(ObjectClass *klass, void *data) dc->realize = arm_sysctl_realize; dc->reset = arm_sysctl_reset; dc->vmsd = &vmstate_arm_sysctl; - dc->props = arm_sysctl_properties; +device_class_set_props (dc, arm_sysctl_properties); }static const TypeInfo arm_sysctl_info = {hw/misc/aspeed_scu.c +1
-1@@ -307,7 +307,7 @@ static void aspeed_scu_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_scu_reset; dc->desc ="ASPEED System Control Unit" ; dc->vmsd = &vmstate_aspeed_scu; - dc->props = aspeed_scu_properties; +device_class_set_props (dc, aspeed_scu_properties); }static const TypeInfo aspeed_scu_info = {hw/misc/aspeed_sdmc.c +1
-1@@ -262,7 +262,7 @@ static void aspeed_sdmc_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_sdmc_reset; dc->desc ="ASPEED SDRAM Memory Controller" ; dc->vmsd = &vmstate_aspeed_sdmc; - dc->props = aspeed_sdmc_properties; +device_class_set_props (dc, aspeed_sdmc_properties); }static const TypeInfo aspeed_sdmc_info = {hw/misc/bcm2835_property.c +1
-1@@ -419,7 +419,7 @@ static void bcm2835_property_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = bcm2835_property_props; +device_class_set_props (dc, bcm2835_property_props); dc->realize = bcm2835_property_realize; dc->vmsd = &vmstate_bcm2835_property; }hw/misc/debugexit.c +1
-1@@ -58,7 +58,7 @@ static void debug_exit_class_initfn(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = debug_exit_realizefn; - dc->props = debug_exit_properties; +device_class_set_props (dc, debug_exit_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/misc/eccmemctl.c +1
-1@@ -326,7 +326,7 @@ static void ecc_class_init(ObjectClass *klass, void *data) k->init = ecc_init1; dc->reset = ecc_reset; dc->vmsd = &vmstate_ecc; - dc->props = ecc_properties; +device_class_set_props (dc, ecc_properties); }static const TypeInfo ecc_info = {hw/misc/ivshmem.c +3
-3@@ -1074,7 +1074,7 @@ static void ivshmem_plain_class_init(ObjectClass *klass, void *data) k->realize = ivshmem_plain_realize; k->exit = ivshmem_plain_exit; - dc->props = ivshmem_plain_properties; +device_class_set_props (dc, ivshmem_plain_properties); dc->vmsd = &ivshmem_plain_vmsd; }@@ -1136,7 +1136,7 @@ static void ivshmem_doorbell_class_init(ObjectClass *klass, void *data)PCIDeviceClass *k =PCI_DEVICE_CLASS (klass); k->realize = ivshmem_doorbell_realize; - dc->props = ivshmem_doorbell_properties; +device_class_set_props (dc, ivshmem_doorbell_properties); dc->vmsd = &ivshmem_doorbell_vmsd; }@@ -1304,7 +1304,7 @@ static void ivshmem_class_init(ObjectClass *klass, void *data) k->realize = ivshmem_realize; k->revision =0 ; dc->desc ="Inter-VM shared memory (legacy)" ; - dc->props = ivshmem_properties; +device_class_set_props (dc, ivshmem_properties); dc->vmsd = &ivshmem_vmsd; }hw/misc/macio/cuda.c +1
-1@@ -945,7 +945,7 @@ static void cuda_class_init(ObjectClass *oc, void *data) dc->realize = cuda_realizefn; dc->reset = cuda_reset; dc->vmsd = &vmstate_cuda; - dc->props = cuda_properties; +device_class_set_props (dc, cuda_properties);set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }hw/misc/macio/macio.c +1
-1@@ -388,7 +388,7 @@ static void macio_class_init(ObjectClass *klass, void *data) k->vendor_id =PCI_VENDOR_ID_APPLE ; k->class_id =PCI_CLASS_OTHERS <<8 ; - dc->props = macio_properties; +device_class_set_props (dc, macio_properties);set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }hw/misc/mips_cmgcr.c +1
-1@@ -224,7 +224,7 @@ static void mips_gcr_realize(DeviceState *dev, Error **errp)static void mips_gcr_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = mips_gcr_properties; +device_class_set_props (dc, mips_gcr_properties); dc->vmsd = &vmstate_mips_gcr; dc->reset = mips_gcr_reset; dc->realize = mips_gcr_realize;hw/misc/mips_cpc.c +1
-1@@ -159,7 +159,7 @@ static void mips_cpc_class_init(ObjectClass *klass, void *data) dc->realize = mips_cpc_realize; dc->reset = mips_cpc_reset; dc->vmsd = &vmstate_mips_cpc; - dc->props = mips_cpc_properties; +device_class_set_props (dc, mips_cpc_properties); }static const TypeInfo mips_cpc_info = {hw/misc/mips_itu.c +1
-1@@ -503,7 +503,7 @@ static void mips_itu_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = mips_itu_properties; +device_class_set_props (dc, mips_itu_properties); dc->realize = mips_itu_realize; dc->reset = mips_itu_reset; }hw/misc/pvpanic.c +1
-1@@ -124,7 +124,7 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pvpanic_isa_realizefn; - dc->props = pvpanic_isa_properties; +device_class_set_props (dc, pvpanic_isa_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/net/allwinner_emac.c +1
-1@@ -514,7 +514,7 @@ static void aw_emac_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = aw_emac_realize; - dc->props = aw_emac_properties; +device_class_set_props (dc, aw_emac_properties); dc->reset = aw_emac_reset; dc->vmsd = &vmstate_aw_emac; }hw/net/cadence_gem.c +1
-1@@ -1522,7 +1522,7 @@ static void gem_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = gem_realize; - dc->props = gem_properties; +device_class_set_props (dc, gem_properties); dc->vmsd = &vmstate_cadence_gem; dc->reset = gem_reset; }hw/net/dp8393x.c +1
-1@@ -891,7 +891,7 @@ static void dp8393x_class_init(ObjectClass *klass, void *data) dc->realize = dp8393x_realize; dc->reset = dp8393x_reset; dc->vmsd = &vmstate_dp8393x; - dc->props = dp8393x_properties; +device_class_set_props (dc, dp8393x_properties);/* Reason: dma_mr property can't be set */ dc->cannot_instantiate_with_device_add_yet = true; }hw/net/e1000.c +1
-1@@ -1667,7 +1667,7 @@ static void e1000_class_init(ObjectClass *klass, void *data) dc->desc ="Intel Gigabit Ethernet" ; dc->reset = qdev_e1000_reset; dc->vmsd = &vmstate_e1000; - dc->props = e1000_properties; +device_class_set_props (dc, e1000_properties); }static void e1000_instance_init (Object *obj)hw/net/e1000e.c +2
-1@@ -671,7 +671,6 @@ static void e1000e_class_init(ObjectClass *class, void *data) dc->desc ="Intel 82574L GbE Controller" ; dc->reset = e1000e_qdev_reset; dc->vmsd = &e1000e_vmstate; - dc->props = e1000e_properties; e1000e_prop_disable_vnet = qdev_prop_uint8; e1000e_prop_disable_vnet.description ="Do not use virtio headers, " @@ -684,6 +683,8 @@ static void e1000e_class_init(ObjectClass *class, void *data) e1000e_prop_subsys = qdev_prop_uint16; e1000e_prop_subsys.description ="PCI device Subsystem ID" ; +device_class_set_props (dc, e1000e_properties); +set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }hw/net/eepro100.c +1
-1@@ -2082,7 +2082,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data) info =eepro100_get_class_by_name (object_class_get_name (klass));set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); - dc->props = e100_properties; +device_class_set_props (dc, e100_properties); dc->desc = info->desc; k->vendor_id =PCI_VENDOR_ID_INTEL ; k->class_id =PCI_CLASS_NETWORK_ETHERNET ;hw/net/etraxfs_eth.c +1
-1@@ -628,7 +628,7 @@ static void etraxfs_eth_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = fs_eth_init; - dc->props = etraxfs_eth_properties; +device_class_set_props (dc, etraxfs_eth_properties);/* Reason: pointer properties "dma_out", "dma_in" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/net/fsl_etsec/etsec.c +1
-1@@ -416,7 +416,7 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->realize = etsec_realize; dc->reset = etsec_reset; - dc->props = etsec_properties; +device_class_set_props (dc, etsec_properties); }static TypeInfo etsec_info = {hw/net/imx_fec.c +1
-1@@ -1189,7 +1189,7 @@ static void imx_eth_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_imx_eth; dc->reset = imx_eth_reset; - dc->props = imx_eth_properties; +device_class_set_props (dc, imx_eth_properties); dc->realize = imx_eth_realize; dc->desc ="i.MX FEC/ENET Ethernet Controller" ; }hw/net/lan9118.c +1
-1@@ -1365,7 +1365,7 @@ static void lan9118_class_init(ObjectClass *klass, void *data) k->init = lan9118_init1; dc->reset = lan9118_reset; - dc->props = lan9118_properties; +device_class_set_props (dc, lan9118_properties); dc->vmsd = &vmstate_lan9118; }hw/net/lance.c +1
-1@@ -163,7 +163,7 @@ static void lance_class_init(ObjectClass *klass, void *data) dc->fw_name ="ethernet" ; dc->reset = lance_reset; dc->vmsd = &vmstate_lance; - dc->props = lance_properties; +device_class_set_props (dc, lance_properties);/* Reason: pointer property "dma" */ dc->cannot_instantiate_with_device_add_yet = true; }hw/net/milkymist-minimac2.c +1
-1@@ -526,7 +526,7 @@ static void milkymist_minimac2_class_init(ObjectClass *klass, void *data) k->init = milkymist_minimac2_init; dc->reset = milkymist_minimac2_reset; dc->vmsd = &vmstate_milkymist_minimac2; - dc->props = milkymist_minimac2_properties; +device_class_set_props (dc, milkymist_minimac2_properties); }static const TypeInfo milkymist_minimac2_info = {hw/net/mipsnet.c +1
-1@@ -274,7 +274,7 @@ static void mipsnet_class_init(ObjectClass *klass, void *data) dc->desc ="MIPS Simulator network device" ; dc->reset = mipsnet_sysbus_reset; dc->vmsd = &vmstate_mipsnet; - dc->props = mipsnet_properties; +device_class_set_props (dc, mipsnet_properties); }static const TypeInfo mipsnet_info = {hw/net/ne2000-isa.c +1
-1@@ -90,7 +90,7 @@ static void isa_ne2000_class_initfn(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = isa_ne2000_realizefn; - dc->props = ne2000_isa_properties; +device_class_set_props (dc, ne2000_isa_properties); dc->vmsd = &vmstate_isa_ne2000;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }hw/net/ne2000.c +1
-1@@ -776,7 +776,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) k->device_id =PCI_DEVICE_ID_REALTEK_8029 ; k->class_id =PCI_CLASS_NETWORK_ETHERNET ; dc->vmsd = &vmstate_pci_ne2000; - dc->props = ne2000_properties; +device_class_set_props (dc, ne2000_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }hw/net/opencores_eth.c +1
-1@@ -755,7 +755,7 @@ static void open_eth_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->desc ="Opencores 10/100 Mbit Ethernet" ; dc->reset = qdev_open_eth_reset; - dc->props = open_eth_properties; +device_class_set_props (dc, open_eth_properties); }static const TypeInfo open_eth_info = {hw/net/pcnet-pci.c +1
-1@@ -355,7 +355,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_NETWORK_ETHERNET ; dc->reset = pci_reset; dc->vmsd = &vmstate_pci_pcnet; - dc->props = pcnet_properties; +device_class_set_props (dc, pcnet_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }hw/net/rocker/rocker.c +1
-1@@ -1565,7 +1565,7 @@ static void rocker_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->desc ="Rocker Switch" ; dc->reset = rocker_reset; - dc->props = rocker_properties; +device_class_set_props (dc, rocker_properties); dc->vmsd = &rocker_vmsd; }hw/net/rtl8139.c +1
-1@@ -3471,7 +3471,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_NETWORK_ETHERNET ; dc->reset = rtl8139_reset; dc->vmsd = &vmstate_rtl8139; - dc->props = rtl8139_properties; +device_class_set_props (dc, rtl8139_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }hw/net/smc91c111.c +1
-1@@ -791,7 +791,7 @@ static void smc91c111_class_init(ObjectClass *klass, void *data) k->init = smc91c111_init1; dc->reset = smc91c111_reset; dc->vmsd = &vmstate_smc91c111; - dc->props = smc91c111_properties; +device_class_set_props (dc, smc91c111_properties); }static const TypeInfo smc91c111_info = {hw/net/spapr_llan.c +1
-1@@ -849,7 +849,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data) k->dt_compatible ="IBM,l-lan" ; k->signal_mask =0x1 ;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); - dc->props = spapr_vlan_properties; +device_class_set_props (dc, spapr_vlan_properties); k->rtce_window_size =0x10000000 ; dc->vmsd = &vmstate_spapr_llan; }hw/net/stellaris_enet.c +1
-1@@ -495,7 +495,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = stellaris_enet_init; - dc->props = stellaris_enet_properties; +device_class_set_props (dc, stellaris_enet_properties); dc->vmsd = &vmstate_stellaris_enet; }hw/net/virtio-net.c +1
-1@@ -1926,7 +1926,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_net_properties; +device_class_set_props (dc, virtio_net_properties); dc->vmsd = &vmstate_virtio_net;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); vdc->realize = virtio_net_device_realize;hw/net/vmxnet3.c +1
-1@@ -2715,7 +2715,7 @@ static void vmxnet3_class_init(ObjectClass *class, void *data) dc->desc ="VMWare Paravirtualized Ethernet v3" ; dc->reset = vmxnet3_qdev_reset; dc->vmsd = &vmstate_vmxnet3; - dc->props = vmxnet3_properties; +device_class_set_props (dc, vmxnet3_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }hw/net/xgmac.c +1
-1@@ -415,7 +415,7 @@ static void xgmac_enet_class_init(ObjectClass *klass, void *data) sbc->init = xgmac_enet_init; dc->vmsd = &vmstate_xgmac; - dc->props = xgmac_properties; +device_class_set_props (dc, xgmac_properties); }static const TypeInfo xgmac_enet_info = {hw/net/xilinx_axienet.c +1
-1@@ -1031,7 +1031,7 @@ static void xilinx_enet_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = xilinx_enet_realize; - dc->props = xilinx_enet_properties; +device_class_set_props (dc, xilinx_enet_properties); dc->reset = xilinx_axienet_reset; }hw/net/xilinx_ethlite.c +1
-1@@ -261,7 +261,7 @@ static void xilinx_ethlite_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_ethlite_realize; dc->reset = xilinx_ethlite_reset; - dc->props = xilinx_ethlite_properties; +device_class_set_props (dc, xilinx_ethlite_properties); }static const TypeInfo xilinx_ethlite_info = {hw/nvram/ds1225y.c +1
-1@@ -152,7 +152,7 @@ static void nvram_sysbus_class_init(ObjectClass *klass, void *data) k->init = nvram_sysbus_initfn; dc->vmsd = &vmstate_nvram; - dc->props = nvram_sysbus_properties; +device_class_set_props (dc, nvram_sysbus_properties); }static const TypeInfo nvram_sysbus_info = {hw/nvram/fw_cfg.c +2
-2@@ -1029,7 +1029,7 @@ static void fw_cfg_io_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = fw_cfg_io_realize; - dc->props = fw_cfg_io_properties; +device_class_set_props (dc, fw_cfg_io_properties); }static const TypeInfo fw_cfg_io_info = {@@ -1086,7 +1086,7 @@ static void fw_cfg_mem_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = fw_cfg_mem_realize; - dc->props = fw_cfg_mem_properties; +device_class_set_props (dc, fw_cfg_mem_properties); }static const TypeInfo fw_cfg_mem_info = {hw/nvram/mac_nvram.c +1
-1@@ -125,7 +125,7 @@ static void macio_nvram_class_init(ObjectClass *oc, void *data) dc->unrealize = macio_nvram_unrealizefn; dc->reset = macio_nvram_reset; dc->vmsd = &vmstate_macio_nvram; - dc->props = macio_nvram_properties; +device_class_set_props (dc, macio_nvram_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/nvram/spapr_nvram.c +1
-1@@ -246,7 +246,7 @@ static void spapr_nvram_class_init(ObjectClass *klass, void *data) k->dt_type ="nvram" ; k->dt_compatible ="qemu,spapr-nvram" ;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = spapr_nvram_properties; +device_class_set_props (dc, spapr_nvram_properties); dc->vmsd = &vmstate_spapr_nvram; }hw/pci-bridge/ioh3420.c +1
-1@@ -202,7 +202,7 @@ static void ioh3420_class_init(ObjectClass *klass, void *data) dc->desc ="Intel IOH device id 3420 PCIE Root Port" ; dc->reset = ioh3420_reset; dc->vmsd = &vmstate_ioh3420; - dc->props = ioh3420_props; +device_class_set_props (dc, ioh3420_props); }static const TypeInfo ioh3420_info = {hw/pci-bridge/pci_bridge_dev.c +1
-1@@ -225,7 +225,7 @@ static void pci_bridge_dev_class_init(ObjectClass *klass, void *data) k->is_bridge =1 , dc->desc ="Standard PCI Bridge" ; dc->reset = qdev_pci_bridge_dev_reset; - dc->props = pci_bridge_dev_properties; +device_class_set_props (dc, pci_bridge_dev_properties); dc->vmsd = &pci_bridge_dev_vmstate;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); hc->plug = pci_bridge_dev_hotplug_cb;hw/pci-bridge/pci_expander_bridge.c +2
-2@@ -307,7 +307,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_BRIDGE_HOST ; dc->desc ="PCI Expander Bridge" ; - dc->props = pxb_dev_properties; +device_class_set_props (dc, pxb_dev_properties); dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }@@ -341,7 +341,7 @@ static void pxb_pcie_dev_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_BRIDGE_HOST ; dc->desc ="PCI Express Expander Bridge" ; - dc->props = pxb_dev_properties; +device_class_set_props (dc, pxb_dev_properties); dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }hw/pci-bridge/xio3130_downstream.c +1
-1@@ -188,7 +188,7 @@ static void xio3130_downstream_class_init(ObjectClass *klass, void *data) dc->desc ="TI X3130 Downstream Port of PCI Express Switch" ; dc->reset = xio3130_downstream_reset; dc->vmsd = &vmstate_xio3130_downstream; - dc->props = xio3130_downstream_props; +device_class_set_props (dc, xio3130_downstream_props); }static const TypeInfo xio3130_downstream_info = {hw/pci-host/piix.c +1
-1@@ -872,7 +872,7 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) hc->root_bus_path = i440fx_pcihost_root_bus_path; dc->realize = i440fx_pcihost_realize; dc->fw_name ="pci" ; - dc->props = i440fx_props; +device_class_set_props (dc, i440fx_props);/* Reason: needs to be wired up by pc_init1 */ dc->cannot_instantiate_with_device_add_yet = true; }hw/pci-host/ppce500.c +1
-1@@ -531,7 +531,7 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) k->init = e500_pcihost_initfn;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); - dc->props = pcihost_properties; +device_class_set_props (dc, pcihost_properties); dc->vmsd = &vmstate_ppce500_pci; }hw/pci-host/prep.c +1
-1@@ -386,7 +386,7 @@ static void raven_pcihost_class_init(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); dc->realize = raven_pcihost_realizefn; - dc->props = raven_pcihost_properties; +device_class_set_props (dc, raven_pcihost_properties); dc->fw_name ="pci" ; }hw/pci-host/q35.c +1
-1@@ -154,7 +154,7 @@ static void q35_host_class_init(ObjectClass *klass, void *data) hc->root_bus_path = q35_host_root_bus_path; dc->realize = q35_host_realize; - dc->props = mch_props; +device_class_set_props (dc, mch_props);/* Reason: needs to be wired up by pc_q35_init */ dc->cannot_instantiate_with_device_add_yet = true;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories);hw/pci-host/versatile.c +1
-1@@ -502,7 +502,7 @@ static void pci_vpb_class_init(ObjectClass *klass, void *data) dc->realize = pci_vpb_realize; dc->reset = pci_vpb_reset; dc->vmsd = &pci_vpb_vmstate; - dc->props = pci_vpb_properties; +device_class_set_props (dc, pci_vpb_properties);/* Reason: object_unref() hangs */ dc->cannot_destroy_with_object_finalize_yet = true; }hw/pci/pci.c +1
-1@@ -2492,7 +2492,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data) k->realize = pci_qdev_realize; k->unrealize = pci_qdev_unrealize; k->bus_type =TYPE_PCI_BUS ; - k->props = pci_props; +device_class_set_props (k, pci_props); pc->realize = pci_default_realize; }hw/pci/pcie_port.c +2
-2@@ -131,7 +131,7 @@ static void pcie_port_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); - dc->props = pcie_port_props; +device_class_set_props (dc, pcie_port_props); }static const TypeInfo pcie_port_type_info = {@@ -153,7 +153,7 @@ static void pcie_slot_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (oc); - dc->props = pcie_slot_props; +device_class_set_props (dc, pcie_slot_props); hc->plug = pcie_cap_slot_hotplug_cb; hc->unplug_request = pcie_cap_slot_hot_unplug_request_cb; }hw/ppc/pnv.c +1
-1@@ -721,7 +721,7 @@ static void pnv_chip_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = pnv_chip_realize; - dc->props = pnv_chip_properties; +device_class_set_props (dc, pnv_chip_properties); dc->desc ="PowerNV Chip" ; }hw/ppc/pnv_core.c +1
-1@@ -190,7 +190,7 @@ static void pnv_core_class_init(ObjectClass *oc, void *data)PnvCoreClass *pcc =PNV_CORE_CLASS (oc); dc->realize = pnv_core_realize; - dc->props = pnv_core_properties; +device_class_set_props (dc, pnv_core_properties); pcc->cpu_oc =cpu_class_by_name (TYPE_POWERPC_CPU , data); }hw/ppc/spapr_pci.c +1
-1@@ -1696,7 +1696,7 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) hc->root_bus_path = spapr_phb_root_bus_path; dc->realize = spapr_phb_realize; - dc->props = spapr_phb_properties; +device_class_set_props (dc, spapr_phb_properties); dc->reset = spapr_phb_reset; dc->vmsd = &vmstate_spapr_pci;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories);hw/ppc/spapr_pci_vfio.c +1
-1@@ -223,7 +223,7 @@ static void spapr_phb_vfio_class_init(ObjectClass *klass, void *data) {DeviceClass *dc =DEVICE_CLASS (klass); - dc->props = spapr_phb_vfio_properties; +device_class_set_props (dc, spapr_phb_vfio_properties); }static const TypeInfo spapr_phb_vfio_info = {hw/ppc/spapr_rng.c +1
-1@@ -172,7 +172,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data) dc->realize = spapr_rng_realize;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = spapr_rng_properties; +device_class_set_props (dc, spapr_rng_properties); dc->hotpluggable = false; }hw/ppc/spapr_vio.c +1
-1@@ -586,7 +586,7 @@ static void vio_spapr_device_class_init(ObjectClass *klass, void *data) k->realize = spapr_vio_busdev_realize; k->reset = spapr_vio_busdev_reset; k->bus_type =TYPE_SPAPR_VIO_BUS ; - k->props = spapr_vio_props; +device_class_set_props (k, spapr_vio_props); }static const TypeInfo spapr_vio_type_info = {hw/s390x/css-bridge.c +1
-1@@ -125,7 +125,7 @@ static void virtual_css_bridge_class_init(ObjectClass *klass, void *data) hc->unplug = ccw_device_unplug;set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); - dc->props = virtual_css_bridge_properties; +device_class_set_props (dc, virtual_css_bridge_properties); }static const TypeInfo virtual_css_bridge_info = {hw/s390x/ipl.c +1
-1@@ -315,7 +315,7 @@ static void s390_ipl_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = s390_ipl_realize; - dc->props = s390_ipl_properties; +device_class_set_props (dc, s390_ipl_properties); dc->reset = s390_ipl_reset; dc->vmsd = &vmstate_ipl;set_bit (DEVICE_CATEGORY_MISC , dc->categories);hw/s390x/s390-pci-bus.c +1
-1@@ -942,7 +942,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data) dc->reset = s390_pci_device_reset; dc->bus_type =TYPE_S390_PCI_BUS ; dc->realize = s390_pci_device_realize; - dc->props = s390_pci_device_properties; +device_class_set_props (dc, s390_pci_device_properties); }static const TypeInfo s390_pci_device_info = {hw/s390x/virtio-ccw.c +9
-9@@ -1347,7 +1347,7 @@ static void virtio_ccw_net_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_net_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_net_properties; +device_class_set_props (dc, virtio_ccw_net_properties);set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); }@@ -1376,7 +1376,7 @@ static void virtio_ccw_blk_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_blk_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_blk_properties; +device_class_set_props (dc, virtio_ccw_blk_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }@@ -1405,7 +1405,7 @@ static void virtio_ccw_serial_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_serial_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_serial_properties; +device_class_set_props (dc, virtio_ccw_serial_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }@@ -1434,7 +1434,7 @@ static void virtio_ccw_balloon_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_balloon_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_balloon_properties; +device_class_set_props (dc, virtio_ccw_balloon_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }@@ -1463,7 +1463,7 @@ static void virtio_ccw_scsi_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_scsi_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_scsi_properties; +device_class_set_props (dc, virtio_ccw_scsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }@@ -1491,7 +1491,7 @@ static void vhost_ccw_scsi_class_init(ObjectClass *klass, void *data) k->realize = vhost_ccw_scsi_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = vhost_ccw_scsi_properties; +device_class_set_props (dc, vhost_ccw_scsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }@@ -1531,7 +1531,7 @@ static void virtio_ccw_rng_class_init(ObjectClass *klass, void *data) k->realize = virtio_ccw_rng_realize; k->exit = virtio_ccw_exit; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_rng_properties; +device_class_set_props (dc, virtio_ccw_rng_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }@@ -1657,7 +1657,7 @@ static void virtio_ccw_9p_class_init(ObjectClass *klass, void *data) k->exit = virtio_ccw_exit; k->realize = virtio_ccw_9p_realize; dc->reset = virtio_ccw_reset; - dc->props = virtio_ccw_9p_properties; +device_class_set_props (dc, virtio_ccw_9p_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }@@ -1708,7 +1708,7 @@ static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data) k->realize = vhost_vsock_ccw_realize; k->exit = virtio_ccw_exit;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = vhost_vsock_ccw_properties; +device_class_set_props (dc, vhost_vsock_ccw_properties); dc->reset = virtio_ccw_reset; }hw/scsi/megasas.c +1
-1@@ -2515,7 +2515,7 @@ static void megasas_class_init(ObjectClass *oc, void *data) e->osts = info->osts; e->product_name = info->product_name; e->product_version = info->product_version; - dc->props = info->props; +device_class_set_props (dc, info->props); dc->reset = megasas_scsi_reset; dc->vmsd = info->vmsd;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories);hw/scsi/mptsas.c +1
-1@@ -1434,7 +1434,7 @@ static void mptsas1068_class_init(ObjectClass *oc, void *data) pc->subsystem_vendor_id =PCI_VENDOR_ID_LSI_LOGIC ; pc->subsystem_id =0x8000 ; pc->class_id =PCI_CLASS_STORAGE_SCSI ; - dc->props = mptsas_properties; +device_class_set_props (dc, mptsas_properties); dc->reset = mptsas_reset; dc->vmsd = &vmstate_mptsas; dc->desc ="LSI SAS 1068" ;hw/scsi/scsi-bus.c +1
-1@@ -2069,7 +2069,7 @@ static void scsi_device_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_SCSI_BUS ; k->realize = scsi_qdev_realize; k->unrealize = scsi_qdev_unrealize; - k->props = scsi_props; +device_class_set_props (k, scsi_props); }static void scsi_dev_instance_init (Object *obj)hw/scsi/scsi-disk.c +4
-4@@ -2897,7 +2897,7 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc ="virtual SCSI disk" ; - dc->props = scsi_hd_properties; +device_class_set_props (dc, scsi_hd_properties); dc->vmsd = &vmstate_scsi_disk_state; }@@ -2926,7 +2926,7 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc ="virtual SCSI CD-ROM" ; - dc->props = scsi_cd_properties; +device_class_set_props (dc, scsi_cd_properties); dc->vmsd = &vmstate_scsi_disk_state; }@@ -2955,7 +2955,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data) sdc->dma_writev = scsi_block_dma_writev; sdc->need_fua_emulation = scsi_block_no_fua; dc->desc ="SCSI block device passthrough" ; - dc->props = scsi_block_properties; +device_class_set_props (dc, scsi_block_properties); dc->vmsd = &vmstate_scsi_disk_state; }@@ -2993,7 +2993,7 @@ static void scsi_disk_class_initfn(ObjectClass *klass, void *data) dc->fw_name ="disk" ; dc->desc ="virtual SCSI disk or CD-ROM (legacy)" ; dc->reset = scsi_disk_reset; - dc->props = scsi_disk_properties; +device_class_set_props (dc, scsi_disk_properties); dc->vmsd = &vmstate_scsi_disk_state; }hw/scsi/scsi-generic.c +1
-1@@ -605,7 +605,7 @@ static void scsi_generic_class_initfn(ObjectClass *klass, void *data) dc->fw_name ="disk" ; dc->desc ="pass through generic scsi device (/dev/sg*)" ; dc->reset = scsi_generic_reset; - dc->props = scsi_generic_properties; +device_class_set_props (dc, scsi_generic_properties); dc->vmsd = &vmstate_scsi_device; }hw/scsi/spapr_vscsi.c +1
-1@@ -1268,7 +1268,7 @@ static void spapr_vscsi_class_init(ObjectClass *klass, void *data) k->dt_compatible ="IBM,v-scsi" ; k->signal_mask =0x00000001 ;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = spapr_vscsi_properties; +device_class_set_props (dc, spapr_vscsi_properties); k->rtce_window_size =0x10000000 ; dc->vmsd = &vmstate_spapr_vscsi; }hw/scsi/vhost-scsi.c +1
-1@@ -314,7 +314,7 @@ static void vhost_scsi_class_init(ObjectClass *klass, void *data)VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass);FWPathProviderClass *fwc =FW_PATH_PROVIDER_CLASS (klass); - dc->props = vhost_scsi_properties; +device_class_set_props (dc, vhost_scsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = vhost_scsi_realize; vdc->unrealize = vhost_scsi_unrealize;hw/scsi/virtio-scsi.c +1
-1@@ -949,7 +949,7 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data)VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (klass); - dc->props = virtio_scsi_properties; +device_class_set_props (dc, virtio_scsi_properties); dc->vmsd = &vmstate_virtio_scsi;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); vdc->realize = virtio_scsi_device_realize;hw/scsi/vmw_pvscsi.c +1
-1@@ -1292,7 +1292,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data) dc->realize = pvscsi_realize; dc->reset = pvscsi_reset; dc->vmsd = &vmstate_pvscsi; - dc->props = pvscsi_properties; +device_class_set_props (dc, pvscsi_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); hc->unplug = pvscsi_hot_unplug; hc->plug = pvscsi_hotplug;hw/sd/sd.c +1
-1@@ -1914,7 +1914,7 @@ static void sd_class_init(ObjectClass *klass, void *data)SDCardClass *sc =SD_CARD_CLASS (klass); dc->realize = sd_realize; - dc->props = sd_properties; +device_class_set_props (dc, sd_properties); dc->vmsd = &sd_vmstate; dc->reset = sd_reset; dc->bus_type =TYPE_SD_BUS ;hw/sd/sdhci.c +2
-2@@ -1305,7 +1305,7 @@ static void sdhci_pci_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_SYSTEM_SDHCI ;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->vmsd = &sdhci_vmstate; - dc->props = sdhci_pci_properties; +device_class_set_props (dc, sdhci_pci_properties); dc->reset = sdhci_poweron_reset; }@@ -1356,7 +1356,7 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &sdhci_vmstate; - dc->props = sdhci_sysbus_properties; +device_class_set_props (dc, sdhci_sysbus_properties); dc->realize = sdhci_sysbus_realize; dc->reset = sdhci_poweron_reset; }hw/sparc/sun4m.c +2
-2@@ -728,7 +728,7 @@ static void prom_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = prom_init1; - dc->props = prom_properties; +device_class_set_props (dc, prom_properties); }static const TypeInfo prom_info = {@@ -795,7 +795,7 @@ static void ram_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = ram_init1; - dc->props = ram_properties; +device_class_set_props (dc, ram_properties); }static const TypeInfo ram_info = {hw/sparc64/sun4u.c +2
-2@@ -652,7 +652,7 @@ static void prom_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = prom_init1; - dc->props = prom_properties; +device_class_set_props (dc, prom_properties); }static const TypeInfo prom_info = {@@ -713,7 +713,7 @@ static void ram_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = ram_init1; - dc->props = ram_properties; +device_class_set_props (dc, ram_properties); }static const TypeInfo ram_info = {hw/ssi/aspeed_smc.c +1
-1@@ -605,7 +605,7 @@ static void aspeed_smc_class_init(ObjectClass *klass, void *data) dc->realize = aspeed_smc_realize; dc->reset = aspeed_smc_reset; - dc->props = aspeed_smc_properties; +device_class_set_props (dc, aspeed_smc_properties); dc->vmsd = &vmstate_aspeed_smc; mc->ctrl = data; }hw/ssi/xilinx_spi.c +1
-1@@ -372,7 +372,7 @@ static void xilinx_spi_class_init(ObjectClass *klass, void *data) k->init = xilinx_spi_init; dc->reset = xlx_spi_reset; - dc->props = xilinx_spi_properties; +device_class_set_props (dc, xilinx_spi_properties); dc->vmsd = &vmstate_xilinx_spi; }hw/ssi/xilinx_spips.c +1
-1@@ -705,7 +705,7 @@ static void xilinx_spips_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_spips_realize; dc->reset = xilinx_spips_reset; - dc->props = xilinx_spips_properties; +device_class_set_props (dc, xilinx_spips_properties); dc->vmsd = &vmstate_xilinx_spips; xsc->reg_ops = &spips_ops;hw/timer/a9gtimer.c +1
-1@@ -354,7 +354,7 @@ static void a9_gtimer_class_init(ObjectClass *klass, void *data) dc->realize = a9_gtimer_realize; dc->vmsd = &vmstate_a9_gtimer; dc->reset = a9_gtimer_reset; - dc->props = a9_gtimer_properties; +device_class_set_props (dc, a9_gtimer_properties); }static const TypeInfo a9_gtimer_info = {hw/timer/allwinner-a10-pit.c +1
-1@@ -276,7 +276,7 @@ static void a10_pit_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = a10_pit_reset; - dc->props = a10_pit_properties; +device_class_set_props (dc, a10_pit_properties); dc->desc ="allwinner a10 timer" ; dc->vmsd = &vmstate_a10_pit; }hw/timer/arm_mptimer.c +1
-1@@ -299,7 +299,7 @@ static void arm_mptimer_class_init(ObjectClass *klass, void *data) dc->realize = arm_mptimer_realize; dc->vmsd = &vmstate_arm_mptimer; dc->reset = arm_mptimer_reset; - dc->props = arm_mptimer_properties; +device_class_set_props (dc, arm_mptimer_properties); }static const TypeInfo arm_mptimer_info = {hw/timer/arm_timer.c +1
-1@@ -389,7 +389,7 @@ static void sp804_class_init(ObjectClass *klass, void *data)DeviceClass *k =DEVICE_CLASS (klass); k->realize = sp804_realize; - k->props = sp804_properties; +device_class_set_props (k, sp804_properties); k->vmsd = &vmstate_sp804; }hw/timer/grlib_gptimer.c +1
-1@@ -394,7 +394,7 @@ static void grlib_gptimer_class_init(ObjectClass *klass, void *data) k->init = grlib_gptimer_init; dc->reset = grlib_gptimer_reset; - dc->props = grlib_gptimer_properties; +device_class_set_props (dc, grlib_gptimer_properties); }static const TypeInfo grlib_gptimer_info = {hw/timer/hpet.c +1
-1@@ -770,7 +770,7 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->realize = hpet_realize; dc->reset = hpet_reset; dc->vmsd = &vmstate_hpet; - dc->props = hpet_device_properties; +device_class_set_props (dc, hpet_device_properties); }static const TypeInfo hpet_device_info = {hw/timer/i8254.c +1
-1@@ -365,7 +365,7 @@ static void pit_class_initfn(ObjectClass *klass, void *data) k->get_channel_info = pit_get_channel_info_common; k->post_load = pit_post_load; dc->reset = pit_reset; - dc->props = pit_properties; +device_class_set_props (dc, pit_properties); }static const TypeInfo pit_info = {hw/timer/lm32_timer.c +1
-1@@ -222,7 +222,7 @@ static void lm32_timer_class_init(ObjectClass *klass, void *data) dc->realize = lm32_timer_realize; dc->reset = timer_reset; dc->vmsd = &vmstate_lm32_timer; - dc->props = lm32_timer_properties; +device_class_set_props (dc, lm32_timer_properties); }static const TypeInfo lm32_timer_info = {hw/timer/m48t59.c +2
-2@@ -822,7 +822,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void *data) dc->realize = m48t59_isa_realize; dc->reset = m48t59_reset_isa; - dc->props = m48t59_isa_properties; +device_class_set_props (dc, m48t59_isa_properties); nc->read = m48txx_isa_read; nc->write = m48txx_isa_write; nc->toggle_lock = m48txx_isa_toggle_lock;@@ -867,7 +867,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data) k->init = m48t59_init1; dc->reset = m48t59_reset_sysbus; - dc->props = m48t59_sysbus_properties; +device_class_set_props (dc, m48t59_sysbus_properties); nc->read = m48txx_sysbus_read; nc->write = m48txx_sysbus_write; nc->toggle_lock = m48txx_sysbus_toggle_lock;hw/timer/mc146818rtc.c +1
-1@@ -952,7 +952,7 @@ static void rtc_class_initfn(ObjectClass *klass, void *data) dc->realize = rtc_realizefn; dc->vmsd = &vmstate_rtc; - dc->props = mc146818rtc_properties; +device_class_set_props (dc, mc146818rtc_properties);/* Reason: needs to be wired up by rtc_init() */ dc->cannot_instantiate_with_device_add_yet = true; }hw/timer/milkymist-sysctl.c +1
-1@@ -328,7 +328,7 @@ static void milkymist_sysctl_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_sysctl_realize; dc->reset = milkymist_sysctl_reset; dc->vmsd = &vmstate_milkymist_sysctl; - dc->props = milkymist_sysctl_properties; +device_class_set_props (dc, milkymist_sysctl_properties); }static const TypeInfo milkymist_sysctl_info = {hw/timer/pxa2xx_timer.c +2
-2@@ -546,7 +546,7 @@ static void pxa25x_timer_dev_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->desc ="PXA25x timer" ; - dc->props = pxa25x_timer_dev_properties; +device_class_set_props (dc, pxa25x_timer_dev_properties); }static const TypeInfo pxa25x_timer_dev_info = {@@ -568,7 +568,7 @@ static void pxa27x_timer_dev_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->desc ="PXA27x timer" ; - dc->props = pxa27x_timer_dev_properties; +device_class_set_props (dc, pxa27x_timer_dev_properties); }static const TypeInfo pxa27x_timer_dev_info = {hw/timer/slavio_timer.c +1
-1@@ -417,7 +417,7 @@ static void slavio_timer_class_init(ObjectClass *klass, void *data) k->init = slavio_timer_init1; dc->reset = slavio_timer_reset; dc->vmsd = &vmstate_slavio_timer; - dc->props = slavio_timer_properties; +device_class_set_props (dc, slavio_timer_properties); }static const TypeInfo slavio_timer_info = {hw/timer/stm32f2xx_timer.c +1
-1@@ -319,7 +319,7 @@ static void stm32f2xx_timer_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->reset = stm32f2xx_timer_reset; - dc->props = stm32f2xx_timer_properties; +device_class_set_props (dc, stm32f2xx_timer_properties); dc->vmsd = &vmstate_stm32f2xx_timer; }hw/timer/xilinx_timer.c +1
-1@@ -247,7 +247,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = xilinx_timer_realize; - dc->props = xilinx_timer_properties; +device_class_set_props (dc, xilinx_timer_properties); }static const TypeInfo xilinx_timer_info = {hw/tpm/tpm_tis.c +1
-1@@ -1079,7 +1079,7 @@ static void tpm_tis_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = tpm_tis_realizefn; - dc->props = tpm_tis_properties; +device_class_set_props (dc, tpm_tis_properties); dc->reset = tpm_tis_reset; dc->vmsd = &vmstate_tpm_tis; }hw/usb/bus.c +1
-1@@ -791,7 +791,7 @@ static void usb_device_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_USB_BUS ; k->realize = usb_qdev_realize; k->unrealize = usb_qdev_unrealize; - k->props = usb_props; +device_class_set_props (k, usb_props); }static const TypeInfo usb_device_type_info = {hw/usb/ccid-card-emulated.c +1
-1@@ -588,7 +588,7 @@ static void emulated_class_initfn(ObjectClass *klass, void *data) cc->apdu_from_guest = emulated_apdu_from_guest;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="emulated smartcard" ; - dc->props = emulated_card_properties; +device_class_set_props (dc, emulated_card_properties); }static const TypeInfo emulated_card_info = {hw/usb/ccid-card-passthru.c +1
-1@@ -402,7 +402,7 @@ static void passthru_class_initfn(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_INPUT , dc->categories); dc->desc ="passthrough smartcard" ; dc->vmsd = &passthru_vmstate; - dc->props = passthru_card_properties; +device_class_set_props (dc, passthru_card_properties); }static const TypeInfo passthru_card_info = {hw/usb/dev-audio.c +1
-1@@ -675,7 +675,7 @@ static void usb_audio_class_init(ObjectClass *klass, void *data)USBDeviceClass *k =USB_DEVICE_CLASS (klass); dc->vmsd = &vmstate_usb_audio; - dc->props = usb_audio_properties; +device_class_set_props (dc, usb_audio_properties);set_bit (DEVICE_CATEGORY_SOUND , dc->categories); k->product_desc ="QEMU USB Audio Interface" ; k->usb_desc = &desc_audio;hw/usb/dev-hid.c +3
-3@@ -812,7 +812,7 @@ static void usb_tablet_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_tablet_realize; uc->product_desc ="QEMU USB Tablet" ; dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_tablet_properties; +device_class_set_props (dc, usb_tablet_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }@@ -835,7 +835,7 @@ static void usb_mouse_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_mouse_realize; uc->product_desc ="QEMU USB Mouse" ; dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_mouse_properties; +device_class_set_props (dc, usb_mouse_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }@@ -859,7 +859,7 @@ static void usb_keyboard_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_keyboard_realize; uc->product_desc ="QEMU USB Keyboard" ; dc->vmsd = &vmstate_usb_kbd; - dc->props = usb_keyboard_properties; +device_class_set_props (dc, usb_keyboard_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }hw/usb/dev-mtp.c +1
-1@@ -1583,7 +1583,7 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data) uc->handle_data = usb_mtp_handle_data; dc->fw_name ="mtp" ; dc->vmsd = &vmstate_usb_mtp; - dc->props = mtp_properties; +device_class_set_props (dc, mtp_properties); }static TypeInfo mtp_info = {hw/usb/dev-network.c +1
-1@@ -1432,7 +1432,7 @@ static void usb_net_class_initfn(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->fw_name ="network" ; dc->vmsd = &vmstate_usb_net; - dc->props = net_properties; +device_class_set_props (dc, net_properties); }static const TypeInfo net_info = {hw/usb/dev-serial.c +2
-2@@ -613,7 +613,7 @@ static void usb_serial_class_initfn(ObjectClass *klass, void *data) uc->product_desc ="QEMU USB Serial" ; uc->usb_desc = &desc_serial; - dc->props = serial_properties; +device_class_set_props (dc, serial_properties); }static const TypeInfo serial_info = {@@ -634,7 +634,7 @@ static void usb_braille_class_initfn(ObjectClass *klass, void *data) uc->product_desc ="QEMU USB Braille" ; uc->usb_desc = &desc_braille; - dc->props = braille_properties; +device_class_set_props (dc, braille_properties); }static const TypeInfo braille_info = {hw/usb/dev-smartcard-reader.c +2
-2@@ -1462,7 +1462,7 @@ static void ccid_class_initfn(ObjectClass *klass, void *data) uc->handle_destroy = ccid_handle_destroy; dc->desc ="CCID Rev 1.1 smartcard reader" ; dc->vmsd = &ccid_vmstate; - dc->props = ccid_properties; +device_class_set_props (dc, ccid_properties);set_bit (DEVICE_CATEGORY_INPUT , dc->categories); hc->unplug = qdev_simple_device_unplug_cb; }@@ -1484,7 +1484,7 @@ static void ccid_card_class_init(ObjectClass *klass, void *data) k->bus_type =TYPE_CCID_BUS ; k->init = ccid_card_init; k->exit = ccid_card_exit; - k->props = ccid_props; +device_class_set_props (k, ccid_props); }static const TypeInfo ccid_card_type_info = {hw/usb/dev-storage.c +1
-1@@ -755,7 +755,7 @@ static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data)USBDeviceClass *uc =USB_DEVICE_CLASS (klass); uc->realize = usb_msd_realize_storage; - dc->props = msd_properties; +device_class_set_props (dc, msd_properties); } static void usb_msd_get_bootindex(Object *obj, Visitor *v, const char *name,hw/usb/dev-uas.c +1
-1@@ -948,7 +948,7 @@ static void usb_uas_class_initfn(ObjectClass *klass, void *data)set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); dc->fw_name ="storage" ; dc->vmsd = &vmstate_usb_uas; - dc->props = uas_properties; +device_class_set_props (dc, uas_properties); }static const TypeInfo uas_info = {hw/usb/hcd-ehci-pci.c +1
-1@@ -150,7 +150,7 @@ static void ehci_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_SERIAL_USB ; k->config_write = usb_ehci_pci_write_config; dc->vmsd = &vmstate_ehci_pci; - dc->props = ehci_pci_properties; +device_class_set_props (dc, ehci_pci_properties); dc->reset = usb_ehci_pci_reset; }hw/usb/hcd-ehci-sysbus.c +1
-1@@ -79,7 +79,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = usb_ehci_sysbus_realize; dc->vmsd = &vmstate_ehci_sysbus; - dc->props = ehci_sysbus_properties; +device_class_set_props (dc, ehci_sysbus_properties); dc->reset = usb_ehci_sysbus_reset;set_bit (DEVICE_CATEGORY_USB , dc->categories); }hw/usb/hcd-ohci.c +2
-2@@ -2124,7 +2124,7 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_SERIAL_USB ;set_bit (DEVICE_CATEGORY_USB , dc->categories); dc->desc ="Apple USB Controller" ; - dc->props = ohci_pci_properties; +device_class_set_props (dc, ohci_pci_properties); dc->hotpluggable = false; dc->vmsd = &vmstate_ohci; dc->reset = usb_ohci_reset_pci;@@ -2150,7 +2150,7 @@ static void ohci_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = ohci_realize_pxa;set_bit (DEVICE_CATEGORY_USB , dc->categories); dc->desc ="OHCI USB Controller" ; - dc->props = ohci_sysbus_properties; +device_class_set_props (dc, ohci_sysbus_properties); dc->reset = usb_ohci_reset_sysbus; }hw/usb/hcd-uhci.c +2
-2@@ -1340,9 +1340,9 @@ static void uhci_data_class_init(ObjectClass *klass, void *data)if (!info->unplug) {/* uhci controllers in companion setups can't be hotplugged */ dc->hotpluggable = false; - dc->props = uhci_properties_companion; +device_class_set_props (dc, uhci_properties_companion); }else { - dc->props = uhci_properties_standalone; +device_class_set_props (dc, uhci_properties_standalone); } u->info = *info; }hw/usb/hcd-xhci.c +1
-1@@ -3945,7 +3945,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->vmsd = &vmstate_xhci; - dc->props = xhci_properties; +device_class_set_props (dc, xhci_properties); dc->reset = xhci_reset;set_bit (DEVICE_CATEGORY_USB , dc->categories); k->realize = usb_xhci_realize;hw/usb/host-libusb.c +1
-1@@ -1573,7 +1573,7 @@ static void usb_host_class_initfn(ObjectClass *klass, void *data) uc->alloc_streams = usb_host_alloc_streams; uc->free_streams = usb_host_free_streams; dc->vmsd = &vmstate_usb_host; - dc->props = usb_host_dev_properties; +device_class_set_props (dc, usb_host_dev_properties);set_bit (DEVICE_CATEGORY_BRIDGE , dc->categories); }hw/usb/redirect.c +1
-1@@ -2508,7 +2508,7 @@ static void usbredir_class_initfn(ObjectClass *klass, void *data) uc->alloc_streams = usbredir_alloc_streams; uc->free_streams = usbredir_free_streams; dc->vmsd = &usbredir_vmstate; - dc->props = usbredir_properties; +device_class_set_props (dc, usbredir_properties);set_bit (DEVICE_CATEGORY_MISC , dc->categories); }hw/vfio/pci.c +1
-1@@ -2886,7 +2886,7 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pdc =PCI_DEVICE_CLASS (klass); dc->reset = vfio_pci_reset; - dc->props = vfio_pci_dev_properties; +device_class_set_props (dc, vfio_pci_dev_properties); dc->vmsd = &vfio_pci_vmstate; dc->desc ="VFIO-based PCI device assignment" ;set_bit (DEVICE_CATEGORY_MISC , dc->categories);hw/vfio/platform.c +1
-1@@ -691,7 +691,7 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *sbc =SYS_BUS_DEVICE_CLASS (klass); dc->realize = vfio_platform_realize; - dc->props = vfio_platform_dev_properties; +device_class_set_props (dc, vfio_platform_dev_properties); dc->vmsd = &vfio_platform_vmstate; dc->desc ="VFIO-based platform device assignment" ; sbc->connect_irq_notifier = vfio_start_irqfd_injection;hw/virtio/vhost-vsock.c +1
-1@@ -390,7 +390,7 @@ static void vhost_vsock_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = vhost_vsock_properties; +device_class_set_props (dc, vhost_vsock_properties); dc->vmsd = &vmstate_virtio_vhost_vsock;set_bit (DEVICE_CATEGORY_MISC , dc->categories); vdc->realize = vhost_vsock_device_realize;hw/virtio/virtio-balloon.c +1
-1@@ -508,7 +508,7 @@ static void virtio_balloon_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_balloon_properties; +device_class_set_props (dc, virtio_balloon_properties); dc->vmsd = &vmstate_virtio_balloon;set_bit (DEVICE_CATEGORY_MISC , dc->categories); vdc->realize = virtio_balloon_device_realize;hw/virtio/virtio-mmio.c +1
-1@@ -496,7 +496,7 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data) dc->realize = virtio_mmio_realizefn; dc->reset = virtio_mmio_reset;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = virtio_mmio_properties; +device_class_set_props (dc, virtio_mmio_properties); }static const TypeInfo virtio_mmio_info = {hw/virtio/virtio-pci.c +10
-10@@ -1137,7 +1137,7 @@ static void virtio_9p_pci_class_init(ObjectClass *klass, void *data) pcidev_k->revision =VIRTIO_PCI_ABI_VERSION ; pcidev_k->class_id =0x2 ;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = virtio_9p_pci_properties; +device_class_set_props (dc, virtio_9p_pci_properties); }static void virtio_9p_pci_instance_init (Object *obj)@@ -1899,7 +1899,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *k =PCI_DEVICE_CLASS (klass);VirtioPCIClass *vpciklass =VIRTIO_PCI_CLASS (klass); - dc->props = virtio_pci_properties; +device_class_set_props (dc, virtio_pci_properties); k->realize = virtio_pci_realize; k->exit = virtio_pci_exit; k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ;@@ -1945,7 +1945,7 @@ static void virtio_blk_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = virtio_blk_pci_properties; +device_class_set_props (dc, virtio_blk_pci_properties); k->realize = virtio_blk_pci_realize; pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_BLOCK ;@@ -2017,7 +2017,7 @@ static void virtio_scsi_pci_class_init(ObjectClass *klass, void *data) k->realize = virtio_scsi_pci_realize;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = virtio_scsi_pci_properties; +device_class_set_props (dc, virtio_scsi_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_SCSI ; pcidev_k->revision =0x00 ;@@ -2072,7 +2072,7 @@ static void vhost_scsi_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = vhost_scsi_pci_realize;set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); - dc->props = vhost_scsi_pci_properties; +device_class_set_props (dc, vhost_scsi_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_SCSI ; pcidev_k->revision =0x00 ;@@ -2122,7 +2122,7 @@ static void vhost_vsock_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = vhost_vsock_pci_realize;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = vhost_vsock_pci_properties; +device_class_set_props (dc, vhost_vsock_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_VSOCK ; pcidev_k->revision =0x00 ;@@ -2174,7 +2174,7 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = virtio_balloon_pci_realize;set_bit (DEVICE_CATEGORY_MISC , dc->categories); - dc->props = virtio_balloon_pci_properties; +device_class_set_props (dc, virtio_balloon_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_BALLOON ; pcidev_k->revision =VIRTIO_PCI_ABI_VERSION ;@@ -2252,7 +2252,7 @@ static void virtio_serial_pci_class_init(ObjectClass *klass, void *data)PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); k->realize = virtio_serial_pci_realize;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); - dc->props = virtio_serial_pci_properties; +device_class_set_props (dc, virtio_serial_pci_properties); pcidev_k->vendor_id =PCI_VENDOR_ID_REDHAT_QUMRANET ; pcidev_k->device_id =PCI_DEVICE_ID_VIRTIO_CONSOLE ; pcidev_k->revision =VIRTIO_PCI_ABI_VERSION ;@@ -2308,7 +2308,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data) k->revision =VIRTIO_PCI_ABI_VERSION ; k->class_id =PCI_CLASS_NETWORK_ETHERNET ;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); - dc->props = virtio_net_properties; +device_class_set_props (dc, virtio_net_properties); vpciklass->realize = virtio_net_pci_realize; }@@ -2406,7 +2406,7 @@ static void virtio_input_pci_class_init(ObjectClass *klass, void *data)VirtioPCIClass *k =VIRTIO_PCI_CLASS (klass);PCIDeviceClass *pcidev_k =PCI_DEVICE_CLASS (klass); - dc->props = virtio_input_pci_properties; +device_class_set_props (dc, virtio_input_pci_properties); k->realize = virtio_input_pci_realize;set_bit (DEVICE_CATEGORY_INPUT , dc->categories);hw/virtio/virtio-rng.c +1
-1@@ -237,7 +237,7 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass);VirtioDeviceClass *vdc =VIRTIO_DEVICE_CLASS (klass); - dc->props = virtio_rng_properties; +device_class_set_props (dc, virtio_rng_properties); dc->vmsd = &vmstate_virtio_rng;set_bit (DEVICE_CATEGORY_MISC , dc->categories); vdc->realize = virtio_rng_device_realize;hw/virtio/virtio.c +1
-1@@ -2166,7 +2166,7 @@ static void virtio_device_class_init(ObjectClass *klass, void *data) dc->realize = virtio_device_realize; dc->unrealize = virtio_device_unrealize; dc->bus_type =TYPE_VIRTIO_BUS ; - dc->props = virtio_properties; +device_class_set_props (dc, virtio_properties); }static const TypeInfo virtio_device_info = {hw/xen/xen_backend.c +1
-1@@ -877,7 +877,7 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data)SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); k->init = xen_sysdev_init; - dc->props = xen_sysdev_properties; +device_class_set_props (dc, xen_sysdev_properties); }static const TypeInfo xensysdev_info = {hw/xen/xen_pt.c +1
-1@@ -948,7 +948,7 @@ static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data) k->config_write = xen_pt_pci_write_config;set_bit (DEVICE_CATEGORY_MISC , dc->categories); dc->desc ="Assign an host PCI device with Xen" ; - dc->props = xen_pci_passthrough_properties; +device_class_set_props (dc, xen_pci_passthrough_properties); };static void xen_pci_passthrough_finalize (Object *obj)include/hw/qdev-core.h +6
-0@@ -401,6 +401,12 @@ static inline bool qbus_is_hotpluggable(BusState *bus)return bus->hotplug_handler; } +/* Set list of static properties for class +* +* It can be called only once per class. +*/ +void device_class_set_props (DeviceClass *dc,Property *props); +void device_listener_register (DeviceListener *listener);void device_listener_unregister (DeviceListener *listener);target-arm/cpu.c +1
-1@@ -1531,7 +1531,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) acc->parent_realize = dc->realize; dc->realize = arm_cpu_realizefn; - dc->props = arm_cpu_properties; +device_class_set_props (dc, arm_cpu_properties); acc->parent_reset = cc->reset; cc->reset = arm_cpu_reset;target-i386/cpu.c +2
-2@@ -1579,7 +1579,7 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)* instance_init, because they require KVM to be initialized. */ - dc->props = host_x86_cpu_properties; +device_class_set_props (dc, host_x86_cpu_properties);/* Reason: host_x86_cpu_initfn() dies when !kvm_enabled() */ dc->cannot_destroy_with_object_finalize_yet = true; }@@ -3651,7 +3651,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) xcc->parent_unrealize = dc->unrealize; dc->realize = x86_cpu_realizefn; dc->unrealize = x86_cpu_unrealizefn; - dc->props = x86_cpu_properties; +device_class_set_props (dc, x86_cpu_properties); xcc->parent_reset = cc->reset; cc->reset = x86_cpu_reset;target-microblaze/cpu.c +1
-1@@ -269,7 +269,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->get_phys_page_debug = mb_cpu_get_phys_page_debug;#endif dc->vmsd = &vmstate_mb_cpu; - dc->props = mb_properties; +device_class_set_props (dc, mb_properties); cc->gdb_num_core_regs =32 +5 ; cc->disas_set_info = mb_disas_set_info;target-ppc/translate_init.c +3
-3@@ -8586,7 +8586,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER7" ; dc->desc ="POWER7" ; - dc->props = powerpc_servercpu_properties; +device_class_set_props (dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power7; pcc->pcr_mask =PCR_VEC_DIS |PCR_VSX_DIS |PCR_COMPAT_2_05 ; pcc->pcr_supported =PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ;@@ -8713,7 +8713,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER8" ; dc->desc ="POWER8" ; - dc->props = powerpc_servercpu_properties; +device_class_set_props (dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power8; pcc->pcr_mask =PCR_TM_DIS |PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; pcc->pcr_supported =PCR_COMPAT_2_07 |PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ;@@ -8794,7 +8794,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER9" ; dc->desc ="POWER9" ; - dc->props = powerpc_servercpu_properties; +device_class_set_props (dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power9; pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 ; pcc->init_proc = init_proc_POWER9;tests/test-qdev-global-props.c +1
-1@@ -53,7 +53,7 @@ static void static_prop_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize =NULL ; - dc->props = static_props; +device_class_set_props (dc, static_props); }static const TypeInfo static_prop_type = {
Re: [Qemu-devel] [PATCH v4 1/8] tests: check-qom-proplist: Remove duplicate "bv" property
In reply to Eduardo HabkostQuoted 10 lines · Eduardo Habkost
The
object_property_add_bool()call indummy_init()is always failing because there is an existing "bv" class property. We need to remove either the "bv" class property or the "bv" instance property.Remove the class property so both object properties and class properties are covered by the test code.
Reviewed-by Igor Mammedov <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>
I accidentally reviewed an older version of this patch. Just in case:
The multiple colons in the subject are a bit odd. Suggest "tests/check-qom-proplist:".
Re: [Qemu-devel] [PATCH v4 1/8] tests: check-qom-proplist: Remove duplicate "bv" property
Quoted 10 lines · Markus Armbruster
Quoted 8 lines · Eduardo Habkost
The
object_property_add_bool()call indummy_init()is always failing because there is an existing "bv" class property. We need to remove either the "bv" class property or the "bv" instance property.Remove the class property so both object properties and class properties are covered by the test code.
Quoted 8 lines
Quoted 2 lines
Reviewed-by Igor Mammedov <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>I accidentally reviewed an older version of this patch. Just in case:
Reviewed-by Markus Armbruster <[email protected]>The multiple colons in the subject are a bit odd. Suggest "tests/check-qom-proplist:".
One more thing: you could test that adding a duplicate property fails.
Re: [Qemu-devel] [PATCH v4 5/8] qdev: Register static properties as class properties
In reply to Eduardo HabkostQuoted 11 lines · Eduardo Habkost
Instead of registering qdev static properties on
instance_init, register them as class properties, atqdev_class_set_props().
qdev_property_add_legacy()was replaced by an equivalentqdev_class_property_add_legacy()function.qdev_property_add_static(), on the other hand, can't be eliminated yet because it is used byarm_cpu_post_init().As class properties don't have a release function called when an object instance is destroyed, the release functions for properties are called manually from
device_finalize().
Ignorant question: should class properties have such a release function?
Hmm, I see object_class_property_add() does take a release(). Is that one called at the wrong time?
One typo noted below.
Quoted 87 lines
Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v1 -> v2:
* (none)Changes v2 -> v3:
* Fix code alignemnt
* Reported-by: Igor Mammedov <[email protected]>Changes series v3 -> v4:
* s/Device/Class/ onqdev_class_property_add_legacy()doc comment
* Reported-by: Igor Mammedov <[email protected]>
* Callprop->info->releaseoninstance_finalize(fix tests/drive_del-test failure)--- hw/core/qdev.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 13 deletions(-)hw/core/qdev.c +27
-10@@ -739,12 +739,12 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, }/** -* qdev_property_add_legacy: -* @dev: Device to add the property to. +* qdev_class_property_add_legacy: +* @oc: Class to add the property to. * @prop: The qdev property definition. * @errp: location to store error information. * -* Add a legacy QOM property to @dev for qdev property @prop. +* Add a legacy QOM property to @oc for qdev property @prop. * On error, store error in @errp. * * Legacy properties are string versions of QOM properties. The format of @@ -754,8 +754,8 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,* Do not use this is new code! QOM Properties added through this interface * will be given names in the "legacy" namespace. */ -static void qdev_property_add_legacy (DeviceState *dev,Property *prop, -Error **errp) +static void qdev_class_property_add_legacy (ObjectClass *oc,Property *prop, +Error **errp) {gchar *name;@@ -765,11 +765,12 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, } name =g_strdup_printf ("legacy-%s" , prop->name); -object_property_add (OBJECT (dev), name,"str" , - prop->info->print ? qdev_get_legacy_property : prop->info->get, -NULL , -NULL , - prop, errp); +object_class_property_add (oc, name,"str" , + prop->info->print ? + qdev_get_legacy_property : + prop->info->get, +NULL ,NULL , + prop, errp);g_free (name); }@@ -844,6 +845,48 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,qdev_property_set_to_default (dev, prop, &error_abort); } +/** +* qdev_class_property_add_static: +* @oc: Class to add the property to. +* @prop: The qdev property definition. +* @errp: location to store error information. +* +* Add a static QOM property to @oc for qdev property @prop. +* On error, store error in @errp. Static properties access data in a struct. +* The type of the QOM property is derived from prop->info. +*/ +static void qdev_class_property_add_static (ObjectClass *oc,Property *prop, +Error **errp) +{ +Error *local_err =NULL ; + +/*
hw/core/qdev.c void qdev_property_add_static(DeviceState *dev, Property *prop, · line 873
Quoted 10 lines
hw/core/qdev.c +10
-0+* TODO qdev_prop_ptr does not have getters or setters. It must +* go now that it can be replaced with links. The test should be +* removed along with it: all static properties are read/write. +*/ +if (!prop->info->get && !prop->info->set) { +return ; + } + +/* Note: prop->info->release is called on device_finalize(), +* because it needs to be called on instaqnce destruction, not on
instance
Quoted 63 lines
hw/core/qdev.c +32
-3+* class property removal. +*/ +object_class_property_add (oc, prop->name, prop->info->name, + prop->info->get, prop->info->set, +NULL , prop, &local_err); + +if (local_err) { +error_propagate (errp, local_err); +return ; + } + +object_class_property_set_description (oc, prop->name, + prop->info->description, + &error_abort); +} +/* @qdev_alias_all_properties - Add alias properties to the source object for * all qdev properties on the target DeviceState. */ @@ -867,8 +910,15 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)void device_class_set_props (DeviceClass *dc,Property *props) { +Property *prop; +ObjectClass *oc =OBJECT_CLASS (dc); +assert (!dc->props); dc->props = props; +for (prop = dc->props; prop && prop->name; prop++) { +qdev_class_property_add_legacy (oc, prop, &error_abort); +qdev_class_property_add_static (oc, prop, &error_abort); + } }static int qdev_add_hotpluggable_device (Object *obj,void *opaque)@@ -1068,8 +1118,7 @@ static void device_initfn(Object *obj) class =object_get_class (OBJECT (dev));do {for (prop =DEVICE_CLASS (class)->props; prop && prop->name; prop++) { -qdev_property_add_legacy (dev, prop, &error_abort); -qdev_property_add_static (dev, prop, &error_abort); +qdev_property_set_to_default (dev, prop, &error_abort); } class =object_class_get_parent (class); }while (class !=object_class_by_name (TYPE_DEVICE ));@@ -1088,9 +1137,16 @@ static void device_post_init(Object *obj)/* Unlink device from bus and free the structure. */ static void device_finalize (Object *obj) { +DeviceState *dev =DEVICE (obj); +DeviceClass *dc =DEVICE_GET_CLASS (dev); +Property *prop;NamedGPIOList *ngl, *next; -DeviceState *dev =DEVICE (obj); +for (prop = dc->props; prop && prop->name; prop++) { +if (prop->info->release) { + prop->info->release (obj, prop->name, prop); + } + } QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {QLIST_REMOVE (ngl, node);
Re: [Qemu-devel] [PATCH v4 6/8] qom: object_class_property_iter_init() function
In reply to Eduardo HabkostQuoted 23 lines · Eduardo Habkost
The new function will allow us to iterate over class properties using the same logic we use for object properties. Unit test included.
Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v1 -> v3:
* (none)Changes series v3 -> v4:
* Trivial whitespace change (removed extra newline)--- include/qom/object.h | 14 ++++++++++++++ qom/object.c | 10 ++++++++-- tests/check-qom-proplist.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-)include/qom/object.h +0
-0@@ -995,6 +995,20 @@ void object_property_iter_init(ObjectPropertyIterator *iter, Object *obj);
include/qom/object.h void object_property_iter_init(ObjectPropertyIterator *iter, · line 1005
Quoted 10 lines
include/qom/object.h +8
-0/** +* object_class_property_iter_init: +* @klass: the class +* +* Initializes an iterator for traversing all properties +* registered against an object class and all parent classes. +* +* It is forbidden to modify the property list while iterating, +* whether removing or adding properties.
You chose not to duplicate the example from object_property_iter_init()'s function comment. That's okay, but you might want to point to it.
Quoted 9 lines
include/qom/object.h +6
-0+*/ +void object_class_property_iter_init (ObjectPropertyIterator *iter, +ObjectClass *klass); + + +/** * object_property_iter_next: * @iter: the iterator instance *
[...]
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
Quoted 11 lines
Quoted 1 line
Perhaps this patch should be part of some other series.
This is a valid point. In this case, it depends on the approach we want to take: do we want to provide a flexible interface for management, let them find ways to make it useful and give us feedback on what is lacking; or do we want to provide the new interface only after we have specified the complete solution for the problem?
I don't know the answer. I will let the qdev/QOM/QMP maintainers answer that.
I'm reluctant to add QMP features just because we think they might be useful to someone. We should talk to users to confirm our hunch before we act on it.
That said, this one isn't exactly a biggie.
Just minor comments, do series
I'd like to see a clearer need for PATCH 7, though. Shouldn't hold up the rest.
Re: [Qemu-devel] [PATCH v4 1/8] tests: check-qom-proplist: Remove duplicate "bv" property
In reply to Eduardo HabkostAm 29.10.2016 um 03:48 schrieb Eduardo Habkost:
Quoted 8 lines
The
object_property_add_bool()call indummy_init()is always failing because there is an existing "bv" class property. We need to remove either the "bv" class property or the "bv" instance property.Remove the class property so both object properties and class properties are covered by the test code.
Quoted 7 lines
Reviewed-by Igor Mammedov <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v2 -> v3:
* Patch imported from "tests: A few check-qom-proplist fixes" series
* Reworded commit message for clarity
So I understand this patch was reordered from a previous separate series. Surely Peter did not merge any pulls that cause test failures, so the first paragraph in the commit message needs rewording?
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
Re: [Qemu-devel] [PATCH v4 5/8] qdev: Register static properties as class properties
In reply to Markus ArmbrusterQuoted 10 lines · Markus Armbruster
Quoted 8 lines · Eduardo Habkost
Instead of registering qdev static properties on
instance_init, register them as class properties, atqdev_class_set_props().
qdev_property_add_legacy()was replaced by an equivalentqdev_class_property_add_legacy()function.qdev_property_add_static(), on the other hand, can't be eliminated yet because it is used byarm_cpu_post_init().
Quoted 5 lines
Quoted 3 lines
As class properties don't have a release function called when an object instance is destroyed, the release functions for properties are called manually from
device_finalize().Ignorant question: should class properties have such a release function?
I don't think they need one (because it is not possible to destroy classes yet). Even if they should, most of the existing QOM release functions are not meant to be called every time an object is destroyed (but still get Object* as argument, which is confusing).
qdev property release functions, on the other hand, are actually meant to be called every time an object is destroyed. (Confusing, uh?)
I have patches to remove the release function and to clarify the intent of qdev release functions. I just didn't include them in this series to keep it simpler.
Quoted 3 lines
Hmm, I see
object_class_property_add()does take arelease(). Is that one called at the wrong time?
The function is actually never called. I thought they were meant to be called when the object is destroyed, but most (but not all?) of the existing release functions are meant to be called to release its void* opaque pointer (so they were really supposed to be called only if the class is being destroyed).
Quoted 3 lines
One typo noted below.
[...]
Quoted 4 lines
hw/core/qdev.c void qdev_property_add_static(DeviceState *dev, Property *prop, · line 873
Quoted 2 lines
hw/core/qdev.c +2
-0+/* Note: prop->info->release is called on device_finalize(), +* because it needs to be called on instaqnce destruction, not on instance
Thanks. I will fix it in the next version.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Markus ArmbrusterQuoted 32 lines · Markus Armbruster
Quoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Quoted 8 lines
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
It does. x86-specific CPU properties are on the x86_64-cpu and i386-cpu classes. arm-specific CPU properties are on the arm-cpu class.
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Perhaps this patch should be part of some other series.
This is a valid point. In this case, it depends on the approach we want to take: do we want to provide a flexible interface for management, let them find ways to make it useful and give us feedback on what is lacking; or do we want to provide the new interface only after we have specified the complete solution for the problem?
Quoted 8 lines
Quoted 2 lines
I don't know the answer. I will let the qdev/QOM/QMP maintainers answer that.
I'm reluctant to add QMP features just because we think they might be useful to someone. We should talk to users to confirm our hunch before we act on it.
That said, this one isn't exactly a biggie.
Considering we are past soft freeze, I can document a more concrete usage example when I submit the next version.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 1/8] tests: check-qom-proplist: Remove duplicate "bv" property
In reply to Andreas FärberQuoted 17 lines · Andreas Färber
Am 29.10.2016 um 03:48 schrieb Eduardo Habkost:
Quoted 8 lines
The
object_property_add_bool()call indummy_init()is always failing because there is an existing "bv" class property. We need to remove either the "bv" class property or the "bv" instance property.Remove the class property so both object properties and class properties are covered by the test code.
Quoted 7 lines
Reviewed-by Igor Mammedov <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v2 -> v3:
* Patch imported from "tests: A few check-qom-proplist fixes" series
* Reworded commit message for clarity
Quoted 3 lines
So I understand this patch was reordered from a previous separate series. Surely Peter did not merge any pulls that cause test failures, so the first paragraph in the commit message needs rewording?
The object_property_add_bool() call is always failing on current master. It doesn't mean the test case is failing (because the errors reported by object_property_add_bool() are being silently ignored).
Would it be clearer if I rewrite it as "The object_property_add_bool() call in dummy_init() is always failing (but the error is being silently ignored) because [...]"?
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 1/8] tests: check-qom-proplist: Remove duplicate "bv" property
Am 04.11.2016 um 17:07 schrieb Eduardo Habkost:
Quoted 22 lines · Andreas Färber
Quoted 17 lines
Am 29.10.2016 um 03:48 schrieb Eduardo Habkost:
Quoted 8 lines
The
object_property_add_bool()call indummy_init()is always failing because there is an existing "bv" class property. We need to remove either the "bv" class property or the "bv" instance property.Remove the class property so both object properties and class properties are covered by the test code.
Quoted 7 lines
Reviewed-by Igor Mammedov <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>---
Changes series v2 -> v3:
* Patch imported from "tests: A few check-qom-proplist fixes" series
* Reworded commit message for clarityQuoted 3 lines
So I understand this patch was reordered from a previous separate series. Surely Peter did not merge any pulls that cause test failures, so the first paragraph in the commit message needs rewording?
Quoted 8 lines
The
object_property_add_bool()call is always failing on current master. It doesn't mean the test case is failing (because the errors reported byobject_property_add_bool()are being silently ignored).Would it be clearer if I rewrite it as "The
object_property_add_bool()call indummy_init()is always failing (but the error is being silently ignored) because [...]"?
Thanks, I can make that tweak myself then.
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 37 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
It does. x86-specific CPU properties are on the x86_64-cpu and i386-cpu classes. arm-specific CPU properties are on the arm-cpu class.
I see we have concrete CPUs (such as "Westmere-x86_64-cpu"), which are subtypes of an abstract CPU (such as "x86_64-cpu"), which is a subtype of "cpu", which is a subtype of "device", which is a subtype of "object".
The chain "cpu" - "device" - "object" is fixed and well-known.
The link from there to the concrete CPU varies. Whether it could be considered well-known or not is debatable.
My true question is: should we have a special purpose interface to get the abstract supertype of concrete CPU types, or should be have general purpose means to introspect the subtype hierarchy?
Note that we have the latter already, although in a rather cumbersome form:
{ "execute": "qom-list-types",
"arguments": { "implements": T, "abstract": true } }lists all subtypes of T. You can filter out the concrete subtypes by subtracting the same query with "abstract": false. Start with the type you're interested in, find all its abstract supertypes. If you need to know more, repeat for the types you found.
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 1 line
Perhaps this patch should be part of some other series.
This is a valid point. In this case, it depends on the approach we want to take: do we want to provide a flexible interface for management, let them find ways to make it useful and give us feedback on what is lacking; or do we want to provide the new interface only after we have specified the complete solution for the problem?
I don't know the answer. I will let the qdev/QOM/QMP maintainers answer that.
Quoted 8 lines
Quoted 5 lines
I'm reluctant to add QMP features just because we think they might be useful to someone. We should talk to users to confirm our hunch before we act on it.
That said, this one isn't exactly a biggie.
Considering we are past soft freeze, I can document a more concrete usage example when I submit the next version.
I recommend you get libvirt developers to buy into this feature first.
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 65 lines · Markus Armbruster
Quoted 37 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
It does. x86-specific CPU properties are on the x86_64-cpu and i386-cpu classes. arm-specific CPU properties are on the arm-cpu class.
I see we have concrete CPUs (such as "Westmere-x86_64-cpu"), which are subtypes of an abstract CPU (such as "x86_64-cpu"), which is a subtype of "cpu", which is a subtype of "device", which is a subtype of "object".
The chain "cpu" - "device" - "object" is fixed and well-known.
The link from there to the concrete CPU varies. Whether it could be considered well-known or not is debatable.
My true question is: should we have a special purpose interface to get the abstract supertype of concrete CPU types, or should be have general purpose means to introspect the subtype hierarchy?
Note that we have the latter already, although in a rather cumbersome form:
Quoted 7 lines
{ "execute": "qom-list-types", "arguments": { "implements": T, "abstract": true } }lists all subtypes of T. You can filter out the concrete subtypes by subtracting the same query with "abstract": false. Start with the type you're interested in, find all its abstract supertypes. If you need to know more, repeat for the types you found.
Looks cumbersome, because I don't see a way to find all supertypes of a given type without walking the whole tree starting from "object" (is there one?). But it could be improved a bit if we added a "implements" field to ObjectTypeInfo.
But, maybe we should take a step back: my original goal was to let libvirt know which properties are supported by any CPU model when using "-cpu". Maybe we should make QEMU do the QOM->option translation and implement "-cpu" support in query-command-line-options? We already do something similar with "-machine".
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 10 lines
Quoted 2 lines
Perhaps this patch should be part of some other series.
This is a valid point. In this case, it depends on the approach we want to take: do we want to provide a flexible interface for management, let them find ways to make it useful and give us feedback on what is lacking; or do we want to provide the new interface only after we have specified the complete solution for the problem?
Quoted 2 lines
I don't know the answer. I will let the qdev/QOM/QMP maintainers answer that.
I'm reluctant to add QMP features just because we think they might be useful to someone. We should talk to users to confirm our hunch before we act on it.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
That said, this one isn't exactly a biggie.
Considering we are past soft freeze, I can document a more concrete usage example when I submit the next version.
I recommend you get libvirt developers to buy into this feature first.
Sure. This series originated from a request by Jiri to let him know which options are supported by "-cpu".
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 7 lines · Eduardo Habkost
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
This will question is slightly off topic (sorry about that) but it does concern the feature you are trying to establish.
I stumbled upon this while trying clean up qdev properties in virtio-ccw. What I dislike is that there is a bunch of properties which are conceptually inherited from ancestor classes (like devno from CcwDevice) yet the qdev properties are independent at the moment (that is each device declares the devno property for itself -- lots of code duplication).
Now here comes the problem. The ioeventfd property is a property of the transport (that is logically belonging to VirtioCcwDevice) and tells if QEMU should use ioeventfd for notifiers. The trouble is this property is not present for vhost devices since basically the ioeventfd is used by the in host kernel vhost driver, so the degree of freedom is gone. By the way, we have the same with virtio-pci and there the ioeventfd property was simply left out of common virtio-pci properties regardless of the properties memory backing (where the set writes to and get reads from) sitting in that is the base class.
Now I think loosing a degree of freedom in the process of specialization is not something outrageous, but I was unable to figure out how this is to be modeled with your class based property approach. Can you help me here?
With the old object anchored properties I was tempted to do something like simply just removing the property form the object or overriding it with a read only property but this would now break the semantic of class properties. Of course having the data backing in the parent and the property in the child does work but is IMHO kind of ugly.
Regards,
Halil
Quoted 2 lines
Signed-off-by Eduardo Habkost <[email protected]>
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 36 lines · Halil Pasic
Quoted 7 lines · Eduardo Habkost
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
This will question is slightly off topic (sorry about that) but it does concern the feature you are trying to establish.
I stumbled upon this while trying clean up qdev properties in virtio-ccw. What I dislike is that there is a bunch of properties which are conceptually inherited from ancestor classes (like devno from CcwDevice) yet the qdev properties are independent at the moment (that is each device declares the devno property for itself -- lots of code duplication).
Now here comes the problem. The ioeventfd property is a property of the transport (that is logically belonging to VirtioCcwDevice) and tells if QEMU should use ioeventfd for notifiers. The trouble is this property is not present for vhost devices since basically the ioeventfd is used by the in host kernel vhost driver, so the degree of freedom is gone. By the way, we have the same with virtio-pci and there the ioeventfd property was simply left out of common virtio-pci properties regardless of the properties memory backing (where the set writes to and get reads from) sitting in that is the base class.
Now I think loosing a degree of freedom in the process of specialization is not something outrageous, but I was unable to figure out how this is to be modeled with your class based property approach. Can you help me here?
Quoted 5 lines
With the old object anchored properties I was tempted to do something like simply just removing the property form the object or overriding it with a read only property but this would now break the semantic of class properties. Of course having the data backing in the parent and the property in the child does work but is IMHO kind of ugly.
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
You have many alternatives in this case: you could use instance properties, or register it as class property only on some subclasses (class_base_init could you help you do it on a single place, instead of duplicating the property registration code on subclasses).
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 74 lines · Eduardo Habkost
Quoted 65 lines · Markus Armbruster
Quoted 37 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
It does. x86-specific CPU properties are on the x86_64-cpu and i386-cpu classes. arm-specific CPU properties are on the arm-cpu class.
I see we have concrete CPUs (such as "Westmere-x86_64-cpu"), which are subtypes of an abstract CPU (such as "x86_64-cpu"), which is a subtype of "cpu", which is a subtype of "device", which is a subtype of "object".
The chain "cpu" - "device" - "object" is fixed and well-known.
The link from there to the concrete CPU varies. Whether it could be considered well-known or not is debatable.
My true question is: should we have a special purpose interface to get the abstract supertype of concrete CPU types, or should be have general purpose means to introspect the subtype hierarchy?
Note that we have the latter already, although in a rather cumbersome form:
Quoted 7 lines
{ "execute": "qom-list-types", "arguments": { "implements": T, "abstract": true } }lists all subtypes of T. You can filter out the concrete subtypes by subtracting the same query with "abstract": false. Start with the type you're interested in, find all its abstract supertypes. If you need to know more, repeat for the types you found.
Quoted 4 lines
Looks cumbersome, because I don't see a way to find all supertypes of a given type without walking the whole tree starting from "object" (is there one?). But it could be improved a bit if we added a "implements" field to ObjectTypeInfo.
My point is: we can skip discussing whether we should expose the subtype relation, because we already do.
Quoted 3 lines
But, maybe we should take a step back: my original goal was to let libvirt know which properties are supported by any CPU model when using "-cpu".
Why is that useful?
Quoted 4 lines
Maybe we should make QEMU do the QOM->optiontranslation and implement "-cpu" support in query-command-line-options? We already do something similar with "-machine".
query-command-line-options is flawed, and the less it's used, the happier I am.
Real command line introspection would be nice, but getting it will involve cleaning up the unholy mess our command line has become. Don't hold your breath.
My preferred workaround is to find something equivalent to introspect via QMP.
That said, if you come up with a patch that solves a real problem now, I won't object to it just because it involves query-command-line-options.
[...]
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit 653ced07 and then the vhost case came along with commit 50787628ee3 (ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).
To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
If yes, how does this relate to patch 5 "Register static properties as class properties" where the object level properties are converted to class level properties?
Quoted 2 lines
You have many alternatives in this case: you could use instance properties
What are inheritance properties? Sorry I'm not quite that deep yet to know myself.
Quoted 4 lines
, or register it as class property only on some subclasses (
class_base_initcould you help you do it on a single place, instead of duplicating the property registration code on subclasses).
Thanks again, and sorry if I'm a bother.
Cheers,
Halil
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Markus ArmbrusterQuoted 76 lines · Markus Armbruster
Quoted 74 lines · Eduardo Habkost
Quoted 72 lines · Markus Armbruster
Quoted 37 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
It does. x86-specific CPU properties are on the x86_64-cpu and i386-cpu classes. arm-specific CPU properties are on the arm-cpu class.
I see we have concrete CPUs (such as "Westmere-x86_64-cpu"), which are subtypes of an abstract CPU (such as "x86_64-cpu"), which is a subtype of "cpu", which is a subtype of "device", which is a subtype of "object".
The chain "cpu" - "device" - "object" is fixed and well-known.
The link from there to the concrete CPU varies. Whether it could be considered well-known or not is debatable.
My true question is: should we have a special purpose interface to get the abstract supertype of concrete CPU types, or should be have general purpose means to introspect the subtype hierarchy?
Note that we have the latter already, although in a rather cumbersome form:
{ "execute": "qom-list-types", "arguments": { "implements": T, "abstract": true } }lists all subtypes of T. You can filter out the concrete subtypes by subtracting the same query with "abstract": false. Start with the type you're interested in, find all its abstract supertypes. If you need to know more, repeat for the types you found.
Quoted 7 lines
Quoted 4 lines
Looks cumbersome, because I don't see a way to find all supertypes of a given type without walking the whole tree starting from "object" (is there one?). But it could be improved a bit if we added a "implements" field to ObjectTypeInfo.
My point is: we can skip discussing whether we should expose the subtype relation, because we already do.
Correct. My only problem is that it seems to add extra assumptions to the code (e.g. that there's only one abstract CPU type). But if libvirt is careful, it doesn't need to make any
assumptions: it can explore the type hierarchy and confirm that the assumptions are correct.
Quoted 6 lines
Quoted 4 lines
But, maybe we should take a step back: my original goal was to let libvirt know which properties are supported by any CPU model when using "-cpu".
Why is that useful?
libvirt wants to know if the QEMU binary supports a given -cpu option (normally CPU features that can be enabled/disabled using "+foo"/"-foo").
Quoted 8 lines
Quoted 5 lines
Maybe we should make QEMU do the QOM->optiontranslation and implement "-cpu" support in query-command-line-options? We already do something similar with "-machine".
query-command-line-options is flawed, and the less it's used, the happier I am.
No problem, let's just forget my suggestion. :)
Quoted 7 lines
Real command line introspection would be nice, but getting it will involve cleaning up the unholy mess our command line has become. Don't hold your breath.
My preferred workaround is to find something equivalent to introspect via QMP.
Sounds good to me.
Quoted 3 lines
That said, if you come up with a patch that solves a real problem now, I won't object to it just because it involves query-command-line-options.
I think I will keep the current approach. Changing query-command-line-option would probably be more complex and solve only the -cpu problem. Making QOM introspection better looks simpler and will probably be useful for other use cases.
I am still tempted to try to make QOM->query-command-line-option mapping easier and simpler, but it doesn't seem to be the answer to the current problem.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Markus ArmbrusterQuoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 70 lines · Daniel P. Berrange
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Quoted 5 lines
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
This would work for me. I only worry that any code that makes the wrong assumptions (on either QEMU or libvirt) would easily go unnoticed until we try to change the class hierarchy and it breaks something.
Markus, what do you think?
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 96 lines · Eduardo Habkost
Quoted 76 lines · Markus Armbruster
Quoted 74 lines · Eduardo Habkost
Quoted 72 lines · Markus Armbruster
Quoted 37 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 16 lines · Eduardo Habkost
(CCing libvirt people, as I forgot to CC them)
Quoted 13 lines · Igor Mammedov
Quoted 7 lines · On Fri, 28 Oct 2016 23:48:06 -0200 Eduardo Habkost <[email protected]> wrote:
When an abstract class is used on device-list-properties, we can simply return the class properties registered for the class.
This will be useful if management software needs to query for supported options that apply to all devices of a given type (e.g. options supported by all CPU models, options supported by all PCI devices).
Patch looks fine to me but I'm not qmp interface guru so I'd leave review up to maintainers.
Quoted 8 lines
Quoted 2 lines
One question though,
How would management software discover typename of abstract class?It depends on the use case. On some cases, management may already have bus-specific logic that will know what's the base type it needs to query (e.g. it may query "pci-device" to find out if all PCI devices support a given option). On other cases, it may be discovered using other commands.
The stated purpose of this feature is to let management software "query for supported options that apply to all devices of a given type". I suspect that when management software has a notion of "a given type", it knows its name.
Will management software go fishing for subtype relationships beyond the types it knows? I doubt it. Of course, management software developers are welcome to educate me :)
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
For the CPU case, I will propose adding the base QOM CPU typename in the query-target command.
Does this type name vary? If yes, can you give examples?
It does. x86-specific CPU properties are on the x86_64-cpu and i386-cpu classes. arm-specific CPU properties are on the arm-cpu class.
I see we have concrete CPUs (such as "Westmere-x86_64-cpu"), which are subtypes of an abstract CPU (such as "x86_64-cpu"), which is a subtype of "cpu", which is a subtype of "device", which is a subtype of "object".
The chain "cpu" - "device" - "object" is fixed and well-known.
The link from there to the concrete CPU varies. Whether it could be considered well-known or not is debatable.
My true question is: should we have a special purpose interface to get the abstract supertype of concrete CPU types, or should be have general purpose means to introspect the subtype hierarchy?
Note that we have the latter already, although in a rather cumbersome form:
{ "execute": "qom-list-types", "arguments": { "implements": T, "abstract": true } }lists all subtypes of T. You can filter out the concrete subtypes by subtracting the same query with "abstract": false. Start with the type you're interested in, find all its abstract supertypes. If you need to know more, repeat for the types you found.
Quoted 7 lines
Quoted 4 lines
Looks cumbersome, because I don't see a way to find all supertypes of a given type without walking the whole tree starting from "object" (is there one?). But it could be improved a bit if we added a "implements" field to ObjectTypeInfo.
My point is: we can skip discussing whether we should expose the subtype relation, because we already do.
Correct. My only problem is that it seems to add extra assumptions to the code (e.g. that there's only one abstract CPU type). But if libvirt is careful, it doesn't need to make any
assumptions: it can explore the type hierarchy and confirm that the assumptions are correct.Quoted 5 lines
Quoted 4 lines
But, maybe we should take a step back: my original goal was to let libvirt know which properties are supported by any CPU model when using "-cpu".
Quoted 5 lines
Quoted 1 line
Why is that useful?
libvirt wants to know if the QEMU binary supports a given -cpu option (normally CPU features that can be enabled/disabled using "+foo"/"-foo").
The obvious way to check whether a specific CPU supports it is to introspect that CPU.
The obvious way to check whether all CPUs of interest support it (assuming that is a productive question) is to introspect all CPUs of interest. Works regardless of whether the option is inherited, which is really an implementation detail.
Quoted 21 lines
Quoted 7 lines
Quoted 4 lines
Maybe we should make QEMU do the QOM->optiontranslation and implement "-cpu" support in query-command-line-options? We already do something similar with "-machine".
query-command-line-options is flawed, and the less it's used, the happier I am.
No problem, let's just forget my suggestion. :)
Quoted 7 lines
Real command line introspection would be nice, but getting it will involve cleaning up the unholy mess our command line has become. Don't hold your breath.
My preferred workaround is to find something equivalent to introspect via QMP.
Sounds good to me.
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
That said, if you come up with a patch that solves a real problem now, I won't object to it just because it involves query-command-line-options.
I think I will keep the current approach. Changing query-command-line-option would probably be more complex and solve only the -cpu problem. Making QOM introspection better looks simpler and will probably be useful for other use cases.
Makes sense.
Quoted 3 lines
I am still tempted to try to make QOM->query-command-line-option mapping easier and simpler, but it doesn't seem to be the answer to the current problem.
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Eduardo HabkostQuoted 77 lines · Eduardo Habkost
Quoted 70 lines · Daniel P. Berrange
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Quoted 5 lines
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
Quoted 6 lines
This would work for me. I only worry that any code that makes the wrong assumptions (on either QEMU or libvirt) would easily go unnoticed until we try to change the class hierarchy and it breaks something.
Markus, what do you think?
I dislike complexity in interface contracts.
Guidance like "if you want to learn the properties of a type T, introspect T" is simple.
Guidance like "if you want to learn the properties common to all subtypes of T, you need to introspect all subtypes of T, except when T is "cpu", you can take a shortcut and introspect T instead" is not simple, and the precedent opens the gates to even more complexity.
Is introspecting all CPU types of interest really that bad?
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 91 lines · Markus Armbruster
Quoted 77 lines · Eduardo Habkost
Quoted 70 lines · Daniel P. Berrange
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Quoted 5 lines
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
Quoted 6 lines
This would work for me. I only worry that any code that makes the wrong assumptions (on either QEMU or libvirt) would easily go unnoticed until we try to change the class hierarchy and it breaks something.
Markus, what do you think?
I dislike complexity in interface contracts.
Guidance like "if you want to learn the properties of a type T, introspect T" is simple.
Quoted 6 lines
Guidance like "if you want to learn the properties common to all subtypes of T, you need to introspect all subtypes of T, except when T is "cpu", you can take a shortcut and introspect T instead" is not simple, and the precedent opens the gates to even more complexity.
Is introspecting all CPU types of interest really that bad?
I'm no sure - adding Jiri who'll ultimately be writing this code ?
If we have to introspect M cpu flags * N cpu models, this will get slow very quickly as IIRC there's 100+ cpu flags, and 10+ models, so 1000+ combinations
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Markus ArmbrusterQuoted 88 lines · Markus Armbruster
Quoted 77 lines · Eduardo Habkost
Quoted 70 lines · Daniel P. Berrange
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Quoted 5 lines
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
Quoted 6 lines
This would work for me. I only worry that any code that makes the wrong assumptions (on either QEMU or libvirt) would easily go unnoticed until we try to change the class hierarchy and it breaks something.
Markus, what do you think?
I dislike complexity in interface contracts.
Quoted 8 lines
Guidance like "if you want to learn the properties of a type T, introspect T" is simple.
Guidance like "if you want to learn the properties common to all subtypes of T, you need to introspect all subtypes of T, except when T is "cpu", you can take a shortcut and introspect T instead" is not simple, and the precedent opens the gates to even more complexity.
+1
Quoted 2 lines
Is introspecting all CPU types of interest really that bad?
A simple to use interface could eventually also be achieved by introducing operations for these things which currently seem cumbersome with (e.g. properties common to all subtypes of T) the current set of (primitive) operations. This would also leave us more degrees of freedom regarding implementation details and also other stuff. (Sorry if this was already discussed with previous versions of the patchset).
Regards,
Halil
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Daniel P. BerrangeQuoted 97 lines · Daniel P. Berrange
Quoted 96 lines · Markus Armbruster
Quoted 77 lines · Eduardo Habkost
Quoted 70 lines · Daniel P. Berrange
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Quoted 5 lines
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
Quoted 6 lines
This would work for me. I only worry that any code that makes the wrong assumptions (on either QEMU or libvirt) would easily go unnoticed until we try to change the class hierarchy and it breaks something.
Markus, what do you think?
I dislike complexity in interface contracts.
Guidance like "if you want to learn the properties of a type T, introspect T" is simple.
Guidance like "if you want to learn the properties common to all subtypes of T, you need to introspect all subtypes of T, except when T is "cpu", you can take a shortcut and introspect T instead" is not simple, and the precedent opens the gates to even more complexity.
Quoted 7 lines
Quoted 1 line
Is introspecting all CPU types of interest really that bad?
I'm no sure - adding Jiri who'll ultimately be writing this code ?
If we have to introspect M cpu flags * N cpu models, this will get slow very quickly as IIRC there's 100+ cpu flags, and 10+ models, so 1000+ combinations
for CPU in CPUs
if this is the first one
common_flags = CPU's flags
else
common_flags &= CPU's flags
Yes, that's O(M*N), but the I/O is O(N): you query for each CPU just once. I'd expect I/O to dominate even with hundreds of CPU flags.
In general, if a management application introspects the same things via QMP multiple times, it's probably doing it wrong.
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 113 lines · Markus Armbruster
Quoted 97 lines · Daniel P. Berrange
Quoted 96 lines · Markus Armbruster
Quoted 77 lines · Eduardo Habkost
Quoted 70 lines · Daniel P. Berrange
Quoted 63 lines · Eduardo Habkost
Quoted 53 lines · Daniel P. Berrange
Quoted 52 lines · Eduardo Habkost
Quoted 36 lines · Markus Armbruster
Quoted 29 lines · Daniel P. Berrange
Quoted 22 lines · Halil Pasic
Quoted 6 lines · Eduardo Habkost
If you want some subclasses to not have the property, then I recommend not registering it as a class property on the base class in the first place. I don't expect to see a mechanism to allow subclasses to remove or override class properties from parent classes.
Thank you very much for your reply.
I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit
653ced07and then the vhost case came along with commit50787628ee3(ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand).To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established.
Quoted 5 lines
Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control?
Quoted 4 lines
This could be an argument for *NOT* allowing introspectiing of properties against abstract parent classes. If you only ever allow introspecting against leaf node non-abstract classes, then QEMU retains the freedom to move props from a base class down to an leaf class without risk of breaking mgmt apps.
Quoted 5 lines
That's a really good point. To generalize it a bit, introspection of actual interfaces is fine, but permitting introspection of how they are made can add artificial constraints.
Introspecting the subtype relation is already problematic in this view.
Yes, that's a very good point. But note that that this means making things more complex for libvirt.
In the case of -cpu, if we don't expose (or allow libvirt to making assumptions about) subtype relations, the only way libvirt can conclude that "+foo can be used as -cpu option with any CPU model", is to query each and every CPU model type, and see if all of them support the "foo" property.
Quoted 8 lines
Quoted 4 lines
It's a trade-off between an interface that's more complex to use and having less freedom to change the class hierarchy. Personally, I don't mind going either way, if we have a good reason for that.
Or could do a tradeoff where we allow introspection of abstract parent classes, but explicitly document that we reserve the right to move properties to leaf nodes ?
Quoted 5 lines
Reserving the right to move properties to leaf nodes would be welcome. But it would force libvirt to query all leaf nodes if it wants to be sure the option is really unsupported by the QEMU binary, so why would libvirt query the parent class in the first place?
Quoted 5 lines
The introspection API is quite general purpose so its semantics have to be suitable for all types of object, but some types of object may not need the full degree of flexibility. So what I meant was that while we want to be able to move props down to leaf classes for objects in general, we could perhaps assume that this will never happen for CPU model objects.
Quoted 6 lines
This would work for me. I only worry that any code that makes the wrong assumptions (on either QEMU or libvirt) would easily go unnoticed until we try to change the class hierarchy and it breaks something.
Markus, what do you think?
I dislike complexity in interface contracts.
Guidance like "if you want to learn the properties of a type T, introspect T" is simple.
Guidance like "if you want to learn the properties common to all subtypes of T, you need to introspect all subtypes of T, except when T is "cpu", you can take a shortcut and introspect T instead" is not simple, and the precedent opens the gates to even more complexity.
Quoted 7 lines
Quoted 1 line
Is introspecting all CPU types of interest really that bad?
I'm no sure - adding Jiri who'll ultimately be writing this code ?
If we have to introspect M cpu flags * N cpu models, this will get slow very quickly as IIRC there's 100+ cpu flags, and 10+ models, so 1000+ combinations
for CPU in CPUs
if this is the first one
common_flags= CPU's flags
else
common_flags&= CPU's flags
Quoted 5 lines
Yes, that's
O(M*N), but the I/O is O(N): you query for each CPU just once. I'd expect I/O to dominate even with hundreds of CPU flags.In general, if a management application introspects the same things via QMP multiple times, it's probably doing it wrong.
Or they could query only the CPU model that is being used for a VM, when validating the VM configuration. But I'm not sure when exactly this information is going to be used by libvirt.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Markus ArmbrusterQuoted 5 lines · Markus Armbruster
Quoted 3 lines · Eduardo Habkost
libvirt wants to know if the QEMU binary supports a given -cpu option (normally CPU features that can be enabled/disabled using "+foo"/"-foo").
Quoted 7 lines
The obvious way to check whether a specific CPU supports it is to introspect that CPU.
The obvious way to check whether all CPUs of interest support it (assuming that is a productive question) is to introspect all CPUs of interest. Works regardless of whether the option is inherited, which is really an implementation detail.
As Eduardo said, libvirt wants to know whether it can use a given CPU feature with current QEMU binary. In -cpu help, we can see a list of models and features QEMU understands, but we need to get similar info via QMP. CPU models are easy, but how do we get the list of CPU features? If introspection is the way to get it, I'm fine with that, just beware that we don't actually know the name of the CPU object (Westmere-x86_64-cpu), we only know the name of the CPU model (Westmere). So if the object name is needed, we need to query the mapping from CPU model names to CPU object names.
Jirka
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
Quoted 14 lines · Jiri Denemark
Quoted 5 lines · Markus Armbruster
Quoted 3 lines · Eduardo Habkost
libvirt wants to know if the QEMU binary supports a given -cpu option (normally CPU features that can be enabled/disabled using "+foo"/"-foo").
Quoted 7 lines
The obvious way to check whether a specific CPU supports it is to introspect that CPU.
The obvious way to check whether all CPUs of interest support it (assuming that is a productive question) is to introspect all CPUs of interest. Works regardless of whether the option is inherited, which is really an implementation detail.
Quoted 9 lines
As Eduardo said, libvirt wants to know whether it can use a given CPU feature with current QEMU binary. In -cpu help, we can see a list of models and features QEMU understands, but we need to get similar info via QMP. CPU models are easy, but how do we get the list of CPU features? If introspection is the way to get it, I'm fine with that, just beware that we don't actually know the name of the CPU object (Westmere-x86_64-cpu), we only know the name of the CPU model (Westmere). So if the object name is needed, we need to query the mapping from CPU model names to CPU object names.
I have patches to add the QOM type name to query-cpu-definitions. I don't remember if I submitted them to qemu-devel already. I will check.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties
In reply to Jiri DenemarkQuoted 14 lines · Jiri Denemark
Quoted 5 lines · Markus Armbruster
Quoted 3 lines · Eduardo Habkost
libvirt wants to know if the QEMU binary supports a given -cpu option (normally CPU features that can be enabled/disabled using "+foo"/"-foo").
Quoted 7 lines
The obvious way to check whether a specific CPU supports it is to introspect that CPU.
The obvious way to check whether all CPUs of interest support it (assuming that is a productive question) is to introspect all CPUs of interest. Works regardless of whether the option is inherited, which is really an implementation detail.
Quoted 8 lines
As Eduardo said, libvirt wants to know whether it can use a given CPU feature with current QEMU binary. In -cpu help, we can see a list of models and features QEMU understands, but we need to get similar info via QMP. CPU models are easy, but how do we get the list of CPU features? If introspection is the way to get it, I'm fine with that, just beware that we don't actually know the name of the CPU object (Westmere-x86_64-cpu), we only know the name of the CPU model (Westmere).
Actually, you do:
{ "execute": "qom-list-types", "arguments": { "implements": "cpu" } }
{"return": [{"name": "Westmere-x86_64-cpu"}, ...]}Quoted 2 lines
So if the object name is needed, we need to query the
mapping from CPU model names to CPU object names.
Hmm. The problem is that some interfaces such as -cpu require a "CPU model name", but introspection gives you the QOM type name. The mapping from "model name" to type name even depends on the target: it's CPUClass method class_by_name().
Can't say I like that, but we got to play the hand we were dealt, and that means we need to provide a way to introspect the mapping between CPU model name and QOM type name. Eduardo's plan to add the QOM type name to query-cpu-definitions makes more sense to me now.