qemu/hw
Andreas Färber fe6c211781 qdev: Fix QOM unrealize behavior
Since commit 249d41720b (qdev: Prepare
"realized" property) setting realized = true would register the device's
VMStateDescription, but realized = false would not unregister it. Fix that.

Moving the code from unparenting also revealed that we were calling
DeviceClass::init through DeviceClass::realize as interim solution but
DeviceClass::exit still at unparenting time with a realized check.
Make this symmetrical by implementing DeviceClass::unrealize to call it,
while we're setting realized = false in the unparenting path.
The only other unrealize user is mac_nvram, which can safely override it.

Thus, mark DeviceClass::exit as obsolete, new devices should implement
DeviceClass::unrealize instead.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1366043650-9719-1-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15 17:05:34 -05:00
..
9pfs virtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge 2013-04-09 07:47:00 -05:00
acpi hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
alpha hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
arm hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
audio hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
block Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
bt hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
char virtio-serial: cleanup: remove qdev field. 2013-04-15 10:22:05 -05:00
core qdev: Fix QOM unrealize behavior 2013-04-15 17:05:34 -05:00
cpu hw: move ARM CPU cores to hw/cpu/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
cris hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
display hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
dma hw: move DMA controllers to hw/dma/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
gpio hw: move GPIO interfaces to hw/gpio/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
i2c hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
i386 hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ide ide: refuse WIN_READ_NATIVE_MAX on empty device 2013-04-15 10:18:05 +02:00
input hw: move timer devices to hw/timer/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
intc Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
isa hw: move ISA bridges and devices to hw/isa/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
lm32 hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
m68k hw: move char devices to hw/char/, configure via default-configs/ 2013-04-08 18:13:14 +02:00
microblaze hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
mips hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
misc hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
moxie hw: move MC146818RTC to hw/timer/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
net Merge remote-tracking branch 'bonzini/hw-dirs' into staging 2013-04-08 13:12:33 -05:00
nvram hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
openrisc hw: move headers to include/ 2013-04-08 18:13:10 +02:00
pci hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
pci-bridge hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
pci-host hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ppc hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
s390x virtio-serial-ccw: switch to the new API. 2013-04-15 10:22:05 -05:00
scsi hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
sd Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
sh4 sh7750: Change cpu field type to SuperHCPU 2013-04-13 13:51:45 +02:00
sparc hw: move other devices to hw/misc/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
sparc64 hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
ssi hw: move SSI controllers to hw/ssi/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
timer hw: move timer devices to hw/timer/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
unicore32 hw: move headers to include/ 2013-04-08 18:13:10 +02:00
usb Merge remote-tracking branch 'bonzini/hw-dirs' into staging 2013-04-08 13:12:33 -05:00
virtio virtio-serial-pci: switch to the new API. 2013-04-15 10:22:04 -05:00
watchdog hw: move watchdogs to hw/watchdog, configure via default-configs/ 2013-04-08 18:13:13 +02:00
xen hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
xtensa hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
Makefile.objs hw: move VFIO and ivshmem to hw/misc/ 2013-04-08 18:13:14 +02:00