qdev: Eliminate qdev_free() in favor of QOM

qdev_free() was trivially wrapping object_delete(). Inline it and drop
the wrapper as a further step to QOM'ify qdev.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
qbus: QOM'ify qbus_realize()

Add the designated Error-reporting argument, even if currently unused.

Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Fold state enum into bool realized

Whether the device was initialized or not is QOM-level information and
currently unused. Drop it from qdev. This leaves the boolean state of
whether or not DeviceClass::init was called or not, a.k.a. "realized".

Suggested-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Prepare "realized" property

Based on earlier patches by Paolo and me, introduce the QOM realizefn at
device level only, as requested by Anthony.

For now this just wraps the qdev initfn.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
isa: Split off instance_init for ISADevice

Signed-off-by: Andreas Färber <afaerber@suse.de>
applesmc: QOM'ify

Add a typedef for the state struct and rename from Status to State.
Add type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cirrus_vga: QOM'ify ISA Cirrus VGA

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
debugcon: QOM'ify ISA debug console

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
fdc: QOM'ify ISA floppy controller

Introduce type constant and cast macro to obsolete DO_UPCAST().
Reuse type constant for PC machine compatibility settings.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Markus Armbruster <armbru@redhat.com>
i82374: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
i8259: Fix PIC_COMMON() macro

It used a wrong struct type name since its introduction in
8f04ee0882aec9fe91fb70f767edf5dacff59835 (isa: pic: convert to QEMU
Object Model), apparently it is unused so far.

Signed-off-by: Andreas Färber <afaerber@suse.de>
i8259: QOM cleanups

Eliminate DO_UPCAST() for PICCommonState. Prepares for ISA realizefn.

Also give the i8259_common type registration functions unique names
while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
ide: QOM'ify ISA IDE

Introduce type constant and cast macro to obsolete DO_UPCAST().
Add missing braces.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
m48t59: QOM'ify ISA M48T59 NVRAM

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
mc146818rtc: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
ne2000-isa: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
parallel: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
pc: QOM'ify port 92

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
pckbd: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
pcspk: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>