@@ -74,7 +74,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
SysBusDevice *sysbusdev;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
@@ -250,7 +250,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
qdev_prop_set_bit(DEVICE(&s->cpus[i]), "has_el2", true);
/* Mark realized */
- qdev_init_nofail(DEVICE(&s->cpus[i]));
+ qdev_realize(DEVICE(&s->cpus[i]), NULL, &error_fatal);
}
/* Generic Interrupt Controller */
@@ -584,8 +584,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
* CPU must exist and have been parented into the cluster before
* the cluster is realized.
*/
- object_property_set_bool(OBJECT(&s->cluster[i]),
- true, "realized", &err);
+ qdev_realize(DEVICE(&s->cluster[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -621,7 +620,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(splitter, true, "realized", &err);
+ qdev_realize(DEVICE(splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -677,8 +676,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->sec_resp_splitter), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->sec_resp_splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -729,8 +727,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->mpc_irq_orgate), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->mpc_irq_orgate), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -889,8 +886,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->ppc_irq_orgate), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->ppc_irq_orgate), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1065,7 +1061,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(&s->nmi_orgate), true, "realized", &err);
+ qdev_realize(DEVICE(&s->nmi_orgate), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1113,7 +1109,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(splitter, true, "realized", &err);
+ qdev_realize(DEVICE(splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1160,7 +1156,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(splitter), true, "realized", &err);
+ qdev_realize(DEVICE(splitter), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -216,7 +216,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
s->cpu->env.nvic = &s->nvic;
s->nvic.cpu = s->cpu;
- object_property_set_bool(OBJECT(s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(s->cpu), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
@@ -302,8 +302,7 @@ static void aspeed_machine_init(MachineState *machine)
object_property_set_int(OBJECT(&bmc->soc), ASPEED_SCU_PROT_KEY,
"hw-prot-key", &error_abort);
}
- object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
- &error_abort);
+ qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
memory_region_add_subregion(get_system_memory(),
sc->memmap[ASPEED_SDRAM],
@@ -259,7 +259,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
* is needed when using -kernel
*/
- object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -230,7 +230,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
/* CPU */
for (i = 0; i < sc->num_cpus; i++) {
- object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -133,8 +133,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
return;
}
- object_property_set_bool(OBJECT(&s->cpu[n].core), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[n].core), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -80,7 +80,7 @@ static void cubieboard_init(MachineState *machine)
exit(1);
}
- object_property_set_bool(OBJECT(a10), true, "realized", &err);
+ qdev_realize(DEVICE(a10), NULL, &err);
if (err != NULL) {
error_reportf_err(err, "Couldn't realize Allwinner A10: ");
exit(1);
@@ -62,7 +62,7 @@ static void digic_realize(DeviceState *dev, Error **errp)
return;
}
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
@@ -62,7 +62,7 @@ static void digic4_board_init(MachineState *machine, DigicBoard *board)
exit(EXIT_FAILURE);
}
- object_property_set_bool(OBJECT(s), true, "realized", &err);
+ qdev_realize(DEVICE(s), NULL, &err);
if (err != NULL) {
error_reportf_err(err, "Couldn't realize DIGIC SoC: ");
exit(1);
@@ -190,7 +190,7 @@ static DeviceState *pl330_create(uint32_t base, qemu_or_irq *orgate,
object_property_set_int(OBJECT(orgate), nevents + 1, "num-lines",
&error_abort);
- object_property_set_bool(OBJECT(orgate), true, "realized", &error_abort);
+ qdev_realize(DEVICE(orgate), NULL, &error_abort);
for (i = 0; i < nevents + 1; i++) {
sysbus_connect_irq(busdev, i, qdev_get_gpio_in(DEVICE(orgate), i));
@@ -223,7 +223,7 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp)
"mp-affinity", &error_abort);
object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
"reset-cbar", &error_abort);
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
}
/*** IRQs ***/
@@ -85,7 +85,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
uint8_t i;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -66,7 +66,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
uint16_t i;
Error *err = NULL;
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -130,7 +130,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
"start-powered-off", &error_abort);
}
- object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -168,8 +168,7 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
object_property_set_int(OBJECT(&s->cpu), QEMU_PSCI_CONDUIT_SMC,
"psci-conduit", &error_abort);
- object_property_set_bool(OBJECT(&s->cpu), true,
- "realized", &error_abort);
+ qdev_realize(DEVICE(&s->cpu), NULL, &error_abort);
/*
* A7MPCORE
@@ -174,7 +174,7 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
"start-powered-off", &error_abort);
}
- object_property_set_bool(o, true, "realized", &error_abort);
+ qdev_realize(DEVICE(o), NULL, &error_abort);
}
/*
@@ -280,7 +280,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
"reset-cbar", &error_abort);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
cpu_fiq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_FIQ);
cpu_virq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_VIRQ);
@@ -75,7 +75,7 @@ static void imx25_pdk_init(MachineState *machine)
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_FSL_IMX25);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
/* We need to initialize our memory */
if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE)) {
@@ -607,7 +607,7 @@ static void integratorcp_init(MachineState *machine)
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu = ARM_CPU(cpuobj);
@@ -73,7 +73,7 @@ static void kzm_init(MachineState *machine)
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_FSL_IMX31);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
/* Check the amount of memory is compatible with the SOC */
if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE)) {
@@ -40,7 +40,7 @@ static void mcimx6ul_evk_init(MachineState *machine)
s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
- object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
machine->ram);
@@ -42,7 +42,7 @@ static void mcimx7d_sabre_init(MachineState *machine)
s = FSL_IMX7(object_new(TYPE_FSL_IMX7));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
- object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX7_MMDC_ADDR,
machine->ram);
@@ -414,8 +414,7 @@ static void mps2tz_common_init(MachineState *machine)
object_property_set_int(OBJECT(splitter), 2, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(splitter), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(splitter), NULL, &error_fatal);
qdev_connect_gpio_out(DEVICE(splitter), 0,
qdev_get_gpio_in_named(DEVICE(&mms->iotkit),
"EXP_IRQ", i));
@@ -433,8 +432,7 @@ static void mps2tz_common_init(MachineState *machine)
object_property_set_int(OBJECT(&mms->sec_resp_splitter),
ARRAY_SIZE(mms->ppc) + ARRAY_SIZE(mms->msc),
"num-lines", &error_fatal);
- object_property_set_bool(OBJECT(&mms->sec_resp_splitter), true,
- "realized", &error_fatal);
+ qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
dev_splitter = DEVICE(&mms->sec_resp_splitter);
qdev_connect_gpio_out_named(iotkitdev, "sec_resp_cfg", 0,
qdev_get_gpio_in(dev_splitter, 0));
@@ -466,8 +464,7 @@ static void mps2tz_common_init(MachineState *machine)
&mms->uart_irq_orgate, TYPE_OR_IRQ);
object_property_set_int(OBJECT(&mms->uart_irq_orgate), 10, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(&mms->uart_irq_orgate), true,
- "realized", &error_fatal);
+ qdev_realize(DEVICE(&mms->uart_irq_orgate), NULL, &error_fatal);
qdev_connect_gpio_out(DEVICE(&mms->uart_irq_orgate), 0,
get_sse_irq_in(mms, 15));
@@ -229,7 +229,7 @@ static void mps2_common_init(MachineState *machine)
orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(orgate, 6, "num-lines", &error_fatal);
- object_property_set_bool(orgate, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(orgate), NULL, &error_fatal);
orgate_dev = DEVICE(orgate);
qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
@@ -266,7 +266,7 @@ static void mps2_common_init(MachineState *machine)
orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(orgate, 10, "num-lines", &error_fatal);
- object_property_set_bool(orgate, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(orgate), NULL, &error_fatal);
orgate_dev = DEVICE(orgate);
qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
@@ -281,8 +281,7 @@ static void mps2_common_init(MachineState *machine)
txrx_orgate = object_new(TYPE_OR_IRQ);
object_property_set_int(txrx_orgate, 2, "num-lines", &error_fatal);
- object_property_set_bool(txrx_orgate, true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(txrx_orgate), NULL, &error_fatal);
txrx_orgate_dev = DEVICE(txrx_orgate);
qdev_connect_gpio_out(txrx_orgate_dev, 0,
qdev_get_gpio_in(armv7m, uart_txrx_irqno[i]));
@@ -405,8 +405,7 @@ static void musca_init(MachineState *machine)
object_property_set_int(OBJECT(splitter), 2, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(splitter), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(splitter), NULL, &error_fatal);
qdev_connect_gpio_out(DEVICE(splitter), 0,
qdev_get_gpio_in_named(ssedev, "EXP_IRQ", i));
qdev_connect_gpio_out(DEVICE(splitter), 1,
@@ -425,8 +424,7 @@ static void musca_init(MachineState *machine)
object_property_set_int(OBJECT(&mms->sec_resp_splitter),
ARRAY_SIZE(mms->ppc), "num-lines", &error_fatal);
- object_property_set_bool(OBJECT(&mms->sec_resp_splitter), true,
- "realized", &error_fatal);
+ qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
dev_splitter = DEVICE(&mms->sec_resp_splitter);
qdev_connect_gpio_out_named(ssedev, "sec_resp_cfg", 0,
qdev_get_gpio_in(dev_splitter, 0));
@@ -86,7 +86,7 @@ static void orangepi_init(MachineState *machine)
&error_abort);
/* Mark H3 object realized */
- object_property_set_bool(OBJECT(h3), true, "realized", &error_abort);
+ qdev_realize(DEVICE(h3), NULL, &error_abort);
/* Retrieve SD bus */
di = drive_get_next(IF_SD);
@@ -287,7 +287,7 @@ static void raspi_machine_init(MachineState *machine)
object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram));
object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
&error_abort);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_abort);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
/* Create and plug in the SD cards */
di = drive_get_next(IF_SD);
@@ -114,7 +114,7 @@ static void realview_init(MachineState *machine,
&error_fatal);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpuobj), ARM_CPU_IRQ);
}
@@ -51,7 +51,7 @@ static void sabrelite_init(MachineState *machine)
s = FSL_IMX6(object_new(TYPE_FSL_IMX6));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
- object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX6_MMDC_ADDR,
machine->ram);
@@ -680,7 +680,7 @@ static void sbsa_ref_init(MachineState *machine)
object_property_set_link(cpuobj, OBJECT(secure_sysmem),
"secure-memory", &error_abort);
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
object_unref(cpuobj);
}
@@ -155,7 +155,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
/* ADC 1 to 3 */
object_property_set_int(OBJECT(s->adc_irqs), STM_NUM_ADCS,
"num-lines", &err);
- object_property_set_bool(OBJECT(s->adc_irqs), true, "realized", &err);
+ qdev_realize(DEVICE(s->adc_irqs), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
@@ -173,7 +173,7 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
}
object_property_set_int(OBJECT(&s->adc_irqs), STM_NUM_ADCS,
"num-lines", &err);
- object_property_set_bool(OBJECT(&s->adc_irqs), true, "realized", &err);
+ qdev_realize(DEVICE(&s->adc_irqs), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
@@ -215,7 +215,7 @@ static void versatile_init(MachineState *machine, int board_id)
object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
cpu = ARM_CPU(cpuobj);
@@ -229,7 +229,7 @@ static void init_cpus(MachineState *ms, const char *cpu_type,
object_property_set_int(cpuobj, periphbase,
"reset-cbar", &error_abort);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
}
/* Create the private peripheral devices (including the GIC);
@@ -1819,7 +1819,7 @@ static void machvirt_init(MachineState *machine)
"secure-memory", &error_abort);
}
- object_property_set_bool(cpuobj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
object_unref(cpuobj);
}
fdt_add_timer_nodes(vms);
@@ -202,7 +202,7 @@ static void zynq_init(MachineState *machine)
&error_fatal);
object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
&error_fatal);
- object_property_set_bool(OBJECT(cpu), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(cpu), NULL, &error_fatal);
/* DDR remapped to address zero. */
memory_region_add_subregion(address_space_mem, 0, machine->ram);
@@ -47,7 +47,7 @@ static void versal_create_apu_cpus(Versal *s)
"core-count", &error_abort);
object_property_set_link(obj, OBJECT(&s->fpd.apu.mr), "memory",
&error_abort);
- object_property_set_bool(obj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(obj), NULL, &error_fatal);
}
}
@@ -125,7 +125,7 @@ static void xlnx_zcu102_init(MachineState *machine)
object_property_set_bool(OBJECT(&s->soc), s->virt, "virtualization",
&error_fatal);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
/* Create and plug in the SD cards */
for (i = 0; i < XLNX_ZYNQMP_NUM_SDHCI; i++) {
@@ -209,15 +209,14 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
&error_abort);
- object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
- &err);
+ qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
}
}
- qdev_init_nofail(DEVICE(&s->rpu_cluster));
+ qdev_realize(DEVICE(&s->rpu_cluster), NULL, &error_fatal);
}
static void xlnx_zynqmp_init(Object *obj)
@@ -341,7 +340,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
qdev_prop_set_bit(DEVICE(&s->gic),
"has-virtualization-extensions", s->virt);
- qdev_init_nofail(DEVICE(&s->apu_cluster));
+ qdev_realize(DEVICE(&s->apu_cluster), NULL, &error_fatal);
/* Realize APUs before realizing the GIC. KVM requires this. */
for (i = 0; i < num_apus; i++) {
@@ -368,8 +367,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
"reset-cbar", &error_abort);
object_property_set_int(OBJECT(&s->apu_cpu[i]), num_apus,
"core-count", &error_abort);
- object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
- &err);
+ qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -651,7 +651,7 @@ DeviceState *nand_init(BlockBackend *blk, int manf_id, int chip_id)
qdev_prop_set_drive(dev, "drive", blk, &error_fatal);
}
- qdev_init_nofail(dev);
+ qdev_realize(dev, NULL, &error_fatal);
return dev;
}
@@ -74,7 +74,7 @@ static void serial_isa_realizefn(DeviceState *dev, Error **errp)
index++;
isa_init_irq(isadev, &s->irq, isa->isairq);
- object_property_set_bool(OBJECT(s), true, "realized", errp);
+ qdev_realize(DEVICE(s), NULL, errp);
qdev_set_legacy_instance_id(dev, isa->iobase, 3);
memory_region_init_io(&s->io, OBJECT(isa), &serial_io_ops, s, "serial", 8);
@@ -106,7 +106,7 @@ static void multi_serial_pci_realize(PCIDevice *dev, Error **errp)
for (i = 0; i < nports; i++) {
s = pci->state + i;
- object_property_set_bool(OBJECT(s), true, "realized", &err);
+ qdev_realize(DEVICE(s), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
multi_serial_pci_exit(dev);
@@ -49,7 +49,7 @@ static void serial_pci_realize(PCIDevice *dev, Error **errp)
SerialState *s = &pci->state;
Error *err = NULL;
- object_property_set_bool(OBJECT(s), true, "realized", &err);
+ qdev_realize(DEVICE(s), NULL, &err);
if (err != NULL) {
error_propagate(errp, err);
return;
@@ -991,7 +991,7 @@ static void serial_io_realize(DeviceState *dev, Error **errp)
SerialState *s = &sio->serial;
Error *local_err = NULL;
- object_property_set_bool(OBJECT(s), true, "realized", &local_err);
+ qdev_realize(DEVICE(s), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1098,7 +1098,7 @@ static void serial_mm_realize(DeviceState *dev, Error **errp)
SerialState *s = &smm->serial;
Error *local_err = NULL;
- object_property_set_bool(OBJECT(s), true, "realized", &local_err);
+ qdev_realize(DEVICE(s), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -59,7 +59,7 @@ CPUState *cpu_create(const char *typename)
{
Error *err = NULL;
CPUState *cpu = CPU(object_new(typename));
- object_property_set_bool(OBJECT(cpu), true, "realized", &err);
+ qdev_realize(DEVICE(cpu), NULL, &err);
if (err != NULL) {
error_report_err(err);
object_unref(OBJECT(cpu));
@@ -133,7 +133,7 @@ void hyperv_synic_add(CPUState *cs)
synic->cs = cs;
object_property_add_child(OBJECT(cs), "synic", obj);
object_unref(obj);
- object_property_set_bool(obj, true, "realized", &error_abort);
+ qdev_realize(DEVICE(obj), NULL, &error_abort);
}
void hyperv_synic_reset(CPUState *cs)
@@ -124,7 +124,7 @@ void x86_cpu_new(X86MachineState *x86ms, int64_t apic_id, Error **errp)
cpu = object_new(MACHINE(x86ms)->cpu_type);
object_property_set_uint(cpu, apic_id, "apic-id", &local_err);
- object_property_set_bool(cpu, true, "realized", &local_err);
+ qdev_realize(DEVICE(cpu), NULL, &local_err);
object_unref(cpu);
error_propagate(errp, local_err);
@@ -26,6 +26,7 @@
#include "qemu/osdep.h"
#include "hw/pcmcia.h"
#include "migration/vmstate.h"
+#include "qapi/error.h"
#include "qemu/module.h"
#include "sysemu/dma.h"
@@ -560,7 +561,7 @@ PCMCIACardState *dscm1xxxx_init(DriveInfo *dinfo)
MicroDriveState *md;
md = MICRODRIVE(object_new(TYPE_DSCM1XXXX));
- qdev_init_nofail(DEVICE(md));
+ qdev_realize(DEVICE(md), NULL, &error_fatal);
if (dinfo != NULL) {
ide_create_drive(&md->bus, 0, dinfo);
@@ -1833,7 +1833,7 @@ static void pnv_xive_realize(DeviceState *dev, Error **errp)
&error_fatal);
object_property_set_link(OBJECT(xsrc), OBJECT(xive), "xive",
&error_abort);
- object_property_set_bool(OBJECT(xsrc), true, "realized", &local_err);
+ qdev_realize(DEVICE(xsrc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1843,7 +1843,7 @@ static void pnv_xive_realize(DeviceState *dev, Error **errp)
&error_fatal);
object_property_set_link(OBJECT(end_xsrc), OBJECT(xive), "xive",
&error_abort);
- object_property_set_bool(OBJECT(end_xsrc), true, "realized", &local_err);
+ qdev_realize(DEVICE(end_xsrc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -312,7 +312,7 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)
&error_fatal);
object_property_set_link(OBJECT(xsrc), OBJECT(xive), "xive",
&error_abort);
- object_property_set_bool(OBJECT(xsrc), true, "realized", &local_err);
+ qdev_realize(DEVICE(xsrc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -326,7 +326,7 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)
&error_fatal);
object_property_set_link(OBJECT(end_xsrc), OBJECT(xive), "xive",
&error_abort);
- object_property_set_bool(OBJECT(end_xsrc), true, "realized", &local_err);
+ qdev_realize(DEVICE(end_xsrc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -384,7 +384,7 @@ Object *icp_create(Object *cpu, const char *type, XICSFabric *xi, Error **errp)
object_unref(obj);
object_property_set_link(obj, OBJECT(xi), ICP_PROP_XICS, &error_abort);
object_property_set_link(obj, cpu, ICP_PROP_CPU, &error_abort);
- object_property_set_bool(obj, true, "realized", &local_err);
+ qdev_realize(DEVICE(obj), NULL, &local_err);
if (local_err) {
object_unparent(obj);
error_propagate(errp, local_err);
@@ -765,7 +765,7 @@ Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp)
object_unref(obj);
object_property_set_link(obj, cpu, "cpu", &error_abort);
object_property_set_link(obj, OBJECT(xptr), "presenter", &error_abort);
- object_property_set_bool(obj, true, "realized", &local_err);
+ qdev_realize(DEVICE(obj), NULL, &local_err);
if (local_err) {
goto error;
}
@@ -91,7 +91,7 @@ petalogix_ml605_init(MachineState *machine)
object_property_set_bool(OBJECT(cpu), true, "dcache-writeback",
&error_abort);
object_property_set_bool(OBJECT(cpu), true, "endianness", &error_abort);
- object_property_set_bool(OBJECT(cpu), true, "realized", &error_abort);
+ qdev_realize(DEVICE(cpu), NULL, &error_abort);
/* Attach emulated BRAM through the LMB. */
memory_region_init_ram(phys_lmb_bram, NULL, "petalogix_ml605.lmb_bram",
@@ -71,7 +71,7 @@ petalogix_s3adsp1800_init(MachineState *machine)
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
object_property_set_str(OBJECT(cpu), "7.10.d", "version", &error_abort);
- object_property_set_bool(OBJECT(cpu), true, "realized", &error_abort);
+ qdev_realize(DEVICE(cpu), NULL, &error_abort);
/* Attach emulated BRAM through the LMB. */
memory_region_init_ram(phys_lmb_bram, NULL,
@@ -96,7 +96,7 @@ static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp)
object_property_set_str(OBJECT(&s->cpu), "8.40.b", "version",
&error_abort);
object_property_set_uint(OBJECT(&s->cpu), 0, "pvr", &error_abort);
- object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+ qdev_realize(DEVICE(&s->cpu), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -172,7 +172,7 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
/* Create the PMU device */
object_initialize_child(OBJECT(machine), "pmu", pmu,
TYPE_XLNX_ZYNQMP_PMU_SOC);
- object_property_set_bool(OBJECT(pmu), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(pmu), NULL, &error_fatal);
/* Load the kernel */
microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR,
@@ -1003,7 +1003,7 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp)
&error_abort);
object_property_set_int(OBJECT(&phb->lsis), PNV_PHB3_NUM_LSI, "nr-irqs",
&error_abort);
- object_property_set_bool(OBJECT(&phb->lsis), true, "realized", &local_err);
+ qdev_realize(DEVICE(&phb->lsis), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1022,7 +1022,7 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp)
&error_abort);
object_property_set_int(OBJECT(&phb->msis), PHB3_MAX_MSI, "nr-irqs",
&error_abort);
- object_property_set_bool(OBJECT(&phb->msis), true, "realized", &local_err);
+ qdev_realize(DEVICE(&phb->msis), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1031,7 +1031,7 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp)
/* Power Bus Common Queue */
object_property_set_link(OBJECT(&phb->pbcq), OBJECT(phb), "phb",
&error_abort);
- object_property_set_bool(OBJECT(&phb->pbcq), true, "realized", &local_err);
+ qdev_realize(DEVICE(&phb->pbcq), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1218,7 +1218,7 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
}
object_property_set_int(OBJECT(xsrc), nr_irqs, "nr-irqs", &error_fatal);
object_property_set_link(OBJECT(xsrc), OBJECT(phb), "xive", &error_fatal);
- object_property_set_bool(OBJECT(xsrc), true, "realized", &local_err);
+ qdev_realize(DEVICE(xsrc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -390,7 +390,7 @@ static void pnv_pec_realize(DeviceState *dev, Error **errp)
object_property_set_int(stk_obj, i, "stack-no", &error_abort);
object_property_set_link(stk_obj, OBJECT(pec), "pec", &error_abort);
- object_property_set_bool(stk_obj, true, "realized", &local_err);
+ qdev_realize(DEVICE(stk_obj), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -238,8 +238,7 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
s->or_irq = OR_IRQ(object_new(TYPE_OR_IRQ));
object_property_set_int(OBJECT(s->or_irq), PCI_NUM_PINS, "num-lines",
&error_fatal);
- object_property_set_bool(OBJECT(s->or_irq), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(s->or_irq), NULL, &error_fatal);
sysbus_init_irq(dev, &s->or_irq->out_irq);
for (i = 0; i < PCI_NUM_PINS; i++) {
@@ -1138,7 +1138,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
"bar", &error_fatal);
object_property_set_link(OBJECT(&chip8->psi), OBJECT(chip8->xics),
ICS_PROP_XICS, &error_abort);
- object_property_set_bool(OBJECT(&chip8->psi), true, "realized", &local_err);
+ qdev_realize(DEVICE(&chip8->psi), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1149,8 +1149,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
/* Create LPC controller */
object_property_set_link(OBJECT(&chip8->lpc), OBJECT(&chip8->psi), "psi",
&error_abort);
- object_property_set_bool(OBJECT(&chip8->lpc), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(&chip8->lpc), NULL, &error_fatal);
pnv_xscom_add_subregion(chip, PNV_XSCOM_LPC_BASE, &chip8->lpc.xscom_regs);
chip->dt_isa_nodename = g_strdup_printf("/xscom@%" PRIx64 "/isa@%x",
@@ -1170,7 +1169,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
/* Create the simplified OCC model */
object_property_set_link(OBJECT(&chip8->occ), OBJECT(&chip8->psi), "psi",
&error_abort);
- object_property_set_bool(OBJECT(&chip8->occ), true, "realized", &local_err);
+ qdev_realize(DEVICE(&chip8->occ), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1184,8 +1183,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
/* HOMER */
object_property_set_link(OBJECT(&chip8->homer), OBJECT(chip), "chip",
&error_abort);
- object_property_set_bool(OBJECT(&chip8->homer), true, "realized",
- &local_err);
+ qdev_realize(DEVICE(&chip8->homer), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1352,7 +1350,7 @@ static void pnv_chip_quad_realize(Pnv9Chip *chip9, Error **errp)
&error_fatal, NULL);
object_property_set_int(OBJECT(eq), core_id, "id", &error_fatal);
- object_property_set_bool(OBJECT(eq), true, "realized", &error_fatal);
+ qdev_realize(DEVICE(eq), NULL, &error_fatal);
pnv_xscom_add_subregion(chip, PNV9_XSCOM_EQ_BASE(eq->id),
&eq->xscom_regs);
@@ -1384,7 +1382,7 @@ static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
&error_fatal);
object_property_set_link(OBJECT(pec), OBJECT(get_system_memory()),
"system-memory", &error_abort);
- object_property_set_bool(OBJECT(pec), true, "realized", &local_err);
+ qdev_realize(DEVICE(pec), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1480,7 +1478,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
/* Processor Service Interface (PSI) Host Bridge */
object_property_set_int(OBJECT(&chip9->psi), PNV9_PSIHB_BASE(chip),
"bar", &error_fatal);
- object_property_set_bool(OBJECT(&chip9->psi), true, "realized", &local_err);
+ qdev_realize(DEVICE(&chip9->psi), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1491,7 +1489,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
/* LPC */
object_property_set_link(OBJECT(&chip9->lpc), OBJECT(&chip9->psi), "psi",
&error_abort);
- object_property_set_bool(OBJECT(&chip9->lpc), true, "realized", &local_err);
+ qdev_realize(DEVICE(&chip9->lpc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1505,7 +1503,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
/* Create the simplified OCC model */
object_property_set_link(OBJECT(&chip9->occ), OBJECT(&chip9->psi), "psi",
&error_abort);
- object_property_set_bool(OBJECT(&chip9->occ), true, "realized", &local_err);
+ qdev_realize(DEVICE(&chip9->occ), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1519,8 +1517,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
/* HOMER */
object_property_set_link(OBJECT(&chip9->homer), OBJECT(chip), "chip",
&error_abort);
- object_property_set_bool(OBJECT(&chip9->homer), true, "realized",
- &local_err);
+ qdev_realize(DEVICE(&chip9->homer), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1602,8 +1599,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
/* Processor Service Interface (PSI) Host Bridge */
object_property_set_int(OBJECT(&chip10->psi), PNV10_PSIHB_BASE(chip),
"bar", &error_fatal);
- object_property_set_bool(OBJECT(&chip10->psi), true, "realized",
- &local_err);
+ qdev_realize(DEVICE(&chip10->psi), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1614,8 +1610,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
/* LPC */
object_property_set_link(OBJECT(&chip10->lpc), OBJECT(&chip10->psi), "psi",
&error_abort);
- object_property_set_bool(OBJECT(&chip10->lpc), true, "realized",
- &local_err);
+ qdev_realize(DEVICE(&chip10->lpc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1734,8 +1729,7 @@ static void pnv_chip_core_realize(PnvChip *chip, Error **errp)
"hrmor", &error_fatal);
object_property_set_link(OBJECT(pnv_core), OBJECT(chip), "chip",
&error_abort);
- object_property_set_bool(OBJECT(pnv_core), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(pnv_core), NULL, &error_fatal);
/* Each core has an XSCOM MMIO region */
xscom_core_base = pcc->xscom_core_base(chip, core_hwid);
@@ -235,7 +235,7 @@ IPMIBmc *pnv_bmc_create(PnvPnor *pnor)
obj = object_new(TYPE_IPMI_BMC_SIMULATOR);
object_ref(OBJECT(pnor));
object_property_add_const_link(obj, "pnor", OBJECT(pnor));
- object_property_set_bool(obj, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(obj), NULL, &error_fatal);
/* Install the HIOMAP protocol handlers to access the PNOR */
ipmi_sim_register_netfn(IPMI_BMC_SIMULATOR(obj), IPMI_NETFN_OEM,
@@ -173,7 +173,7 @@ static void pnv_core_cpu_realize(PnvCore *pc, PowerPCCPU *cpu, Error **errp)
Error *local_err = NULL;
PnvChipClass *pcc = PNV_CHIP_GET_CLASS(pc->chip);
- object_property_set_bool(OBJECT(cpu), true, "realized", &local_err);
+ qdev_realize(DEVICE(cpu), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -510,7 +510,7 @@ static void pnv_psi_power8_realize(DeviceState *dev, Error **errp)
error_propagate(errp, err);
return;
}
- object_property_set_bool(OBJECT(ics), true, "realized", &err);
+ qdev_realize(DEVICE(ics), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -851,7 +851,7 @@ static void pnv_psi_power9_realize(DeviceState *dev, Error **errp)
object_property_set_int(OBJECT(xsrc), PSIHB9_NUM_IRQS, "nr-irqs",
&error_fatal);
object_property_set_link(OBJECT(xsrc), OBJECT(psi), "xive", &error_abort);
- object_property_set_bool(OBJECT(xsrc), true, "realized", &local_err);
+ qdev_realize(DEVICE(xsrc), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1730,8 +1730,7 @@ static void spapr_rtc_create(SpaprMachineState *spapr)
object_initialize_child_with_props(OBJECT(spapr), "rtc", &spapr->rtc,
sizeof(spapr->rtc), TYPE_SPAPR_RTC,
&error_fatal, NULL);
- object_property_set_bool(OBJECT(&spapr->rtc), true, "realized",
- &error_fatal);
+ qdev_realize(DEVICE(&spapr->rtc), NULL, &error_fatal);
object_property_add_alias(OBJECT(spapr), "rtc-time", OBJECT(&spapr->rtc),
"date");
}
@@ -2629,7 +2628,7 @@ static void spapr_init_cpus(SpaprMachineState *spapr)
&error_fatal);
object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID,
&error_fatal);
- object_property_set_bool(core, true, "realized", &error_fatal);
+ qdev_realize(DEVICE(core), NULL, &error_fatal);
object_unref(core);
}
@@ -239,7 +239,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
CPUState *cs = CPU(cpu);
Error *local_err = NULL;
- object_property_set_bool(OBJECT(cpu), true, "realized", &local_err);
+ qdev_realize(DEVICE(cpu), NULL, &local_err);
if (local_err) {
goto error;
}
@@ -567,7 +567,7 @@ SpaprDrc *spapr_dr_connector_new(Object *owner, const char *type,
spapr_drc_index(drc));
object_property_add_child(owner, prop_name, OBJECT(drc));
object_unref(OBJECT(drc));
- object_property_set_bool(OBJECT(drc), true, "realized", NULL);
+ qdev_realize(DEVICE(drc), NULL, NULL);
g_free(prop_name);
return drc;
@@ -369,7 +369,7 @@ SpaprTceTable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn)
g_free(tmp);
object_unref(OBJECT(tcet));
- object_property_set_bool(OBJECT(tcet), true, "realized", NULL);
+ qdev_realize(DEVICE(tcet), NULL, NULL);
return tcet;
}
@@ -311,7 +311,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
object_property_set_link(obj, OBJECT(spapr), ICS_PROP_XICS,
&error_abort);
object_property_set_int(obj, smc->nr_xirqs, "nr-irqs", &error_abort);
- object_property_set_bool(obj, true, "realized", &local_err);
+ qdev_realize(DEVICE(obj), NULL, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -61,8 +61,7 @@ static void riscv_opentitan_init(MachineState *machine)
/* Initialize SoC */
object_initialize_child(OBJECT(machine), "soc", &s->soc,
TYPE_RISCV_IBEX_SOC);
- object_property_set_bool(OBJECT(&s->soc), true, "realized",
- &error_abort);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
memory_region_init_ram(main_mem, NULL, "riscv.lowrisc.ibex.ram",
memmap[IBEX_RAM].size, &error_fatal);
@@ -48,8 +48,7 @@ static void riscv_hart_realize(RISCVHartArrayState *s, int idx,
object_initialize_child(OBJECT(s), "harts[*]", &s->harts[idx], cpu_type);
s->harts[idx].env.mhartid = s->hartid_base + idx;
qemu_register_reset(riscv_harts_cpu_reset, &s->harts[idx]);
- object_property_set_bool(OBJECT(&s->harts[idx]), true,
- "realized", &err);
+ qdev_realize(DEVICE(&s->harts[idx]), NULL, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -86,8 +86,7 @@ static void riscv_sifive_e_init(MachineState *machine)
/* Initialize SoC */
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_E_SOC);
- object_property_set_bool(OBJECT(&s->soc), true, "realized",
- &error_abort);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
/* Data Tightly Integrated Memory */
memory_region_init_ram(main_mem, NULL, "riscv.sifive.e.ram",
@@ -331,8 +331,7 @@ static void sifive_u_machine_init(MachineState *machine)
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_U_SOC);
object_property_set_uint(OBJECT(&s->soc), s->serial, "serial",
&error_abort);
- object_property_set_bool(OBJECT(&s->soc), true, "realized",
- &error_abort);
+ qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
/* register RAM */
memory_region_init_ram(main_mem, NULL, "riscv.sifive.u.ram",
@@ -530,10 +529,8 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
* CPU must exist and have been parented into the cluster before the
* cluster is realized.
*/
- object_property_set_bool(OBJECT(&s->e_cluster), true, "realized",
- &error_abort);
- object_property_set_bool(OBJECT(&s->u_cluster), true, "realized",
- &error_abort);
+ qdev_realize(DEVICE(&s->e_cluster), NULL, &error_abort);
+ qdev_realize(DEVICE(&s->u_cluster), NULL, &error_abort);
/* boot rom */
memory_region_init_rom(mask_rom, OBJECT(dev), "riscv.sifive.u.mrom",
@@ -48,7 +48,7 @@ void s390_skeys_init(void)
obj);
object_unref(obj);
- qdev_init_nofail(DEVICE(obj));
+ qdev_realize(DEVICE(obj), NULL, &error_fatal);
}
static void write_keys(FILE *f, uint8_t *keys, uint64_t startgfn,
@@ -50,7 +50,7 @@ void s390_stattrib_init(void)
obj);
object_unref(obj);
- qdev_init_nofail(DEVICE(obj));
+ qdev_realize(DEVICE(obj), NULL, &error_fatal);
}
/* Console commands: */
@@ -75,7 +75,7 @@ static S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id,
if (err != NULL) {
goto out;
}
- object_property_set_bool(OBJECT(cpu), true, "realized", &err);
+ qdev_realize(DEVICE(cpu), NULL, &err);
out:
object_unref(OBJECT(cpu));
@@ -210,7 +210,7 @@ static void s390_init_ipl_dev(const char *kernel_filename,
object_property_add_child(qdev_get_machine(), TYPE_S390_IPL,
new);
object_unref(new);
- qdev_init_nofail(dev);
+ qdev_realize(dev, NULL, &error_fatal);
}
static void s390_create_virtio_net(BusState *bus, const char *name)
@@ -322,7 +322,7 @@ void s390_sclp_init(void)
object_property_add_child(qdev_get_machine(), TYPE_SCLP, new);
object_unref(new);
- qdev_init_nofail(DEVICE(new));
+ qdev_realize(DEVICE(new), NULL, &error_fatal);
}
static void sclp_realize(DeviceState *dev, Error **errp)
@@ -29,7 +29,7 @@ void s390_init_tod(void)
object_property_add_child(qdev_get_machine(), TYPE_S390_TOD, obj);
object_unref(obj);
- qdev_init_nofail(DEVICE(obj));
+ qdev_realize(DEVICE(obj), NULL, &error_fatal);
}
S390TODState *s390_get_todstate(void)
@@ -6135,8 +6135,7 @@ static void x86_cpu_apic_realize(X86CPU *cpu, Error **errp)
if (cpu->apic_state == NULL) {
return;
}
- object_property_set_bool(OBJECT(cpu->apic_state), true, "realized",
- errp);
+ qdev_realize(DEVICE(cpu->apic_state), NULL, errp);
/* Map APIC MMIO area */
apic = APIC_COMMON(cpu->apic_state);
@@ -26,6 +26,7 @@
#include "hw/qdev-properties.h"
#include "qom/object.h"
+#include "qapi/error.h"
#include "qapi/visitor.h"
@@ -76,7 +77,7 @@ static void test_static_prop_subprocess(void)
MyType *mt;
mt = STATIC_TYPE(object_new(TYPE_STATIC_PROPS));
- qdev_init_nofail(DEVICE(mt));
+ qdev_realize(DEVICE(mt), NULL, &error_fatal);
g_assert_cmpuint(mt->prop1, ==, PROP_DEFAULT);
}
@@ -111,7 +112,7 @@ static void test_static_globalprop_subprocess(void)
register_global_properties(props);
mt = STATIC_TYPE(object_new(TYPE_STATIC_PROPS));
- qdev_init_nofail(DEVICE(mt));
+ qdev_realize(DEVICE(mt), NULL, &error_fatal);
g_assert_cmpuint(mt->prop1, ==, 200);
g_assert_cmpuint(mt->prop2, ==, PROP_DEFAULT);
@@ -229,7 +230,7 @@ static void test_dynamic_globalprop_subprocess(void)
register_global_properties(props);
mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));
- qdev_init_nofail(DEVICE(mt));
+ qdev_realize(DEVICE(mt), NULL, &error_fatal);
g_assert_cmpuint(mt->prop1, ==, 101);
g_assert_cmpuint(mt->prop2, ==, 102);
@@ -272,7 +273,7 @@ static void test_subclass_global_props(void)
register_global_properties(props);
mt = STATIC_TYPE(object_new(TYPE_SUBCLASS));
- qdev_init_nofail(DEVICE(mt));
+ qdev_realize(DEVICE(mt), NULL, &error_fatal);
g_assert_cmpuint(mt->prop1, ==, 102);
g_assert_cmpuint(mt->prop2, ==, 104);