qdev: add return value to init() callbacks.
commit81a322d4a1b68d47908a6630bf22897a289722aa
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 14 Aug 2009 08:36:05 +0000 (14 10:36 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 28 Aug 2009 01:43:28 +0000 (27 20:43 -0500)
treecdca9840d0620d9e0b46d7b81c58abe04a372b78
parent24e6f3551f3c8ea7cc7524a3e64e84beca59618f
qdev: add return value to init() callbacks.

Sorry folks, but it has to be.  One more of these invasive qdev patches.

We have a serious design bug in the qdev interface:  device init
callbacks can't signal failure because the init() callback has no
return value.  This patch fixes it.

We have already one case in-tree where this is needed:
Try -device virtio-blk-pci (without drive= specified) and watch qemu
segfault.  This patch fixes it.

With usb+scsi being converted to qdev we'll get more devices where the
init callback can fail for various reasons.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
102 files changed:
hw/ac97.c
hw/ads7846.c
hw/apb_pci.c
hw/arm_sysctl.c
hw/arm_timer.c
hw/armv7m.c
hw/armv7m_nvic.c
hw/bitbang_i2c.c
hw/cirrus_vga.c
hw/cs4231.c
hw/e1000.c
hw/eccmemctl.c
hw/eepro100.c
hw/es1370.c
hw/escc.c
hw/esp.c
hw/etraxfs_pic.c
hw/etraxfs_ser.c
hw/etraxfs_timer.c
hw/fdc.c
hw/grackle_pci.c
hw/i2c.c
hw/i2c.h
hw/integratorcp.c
hw/iommu.c
hw/isa-bus.c
hw/isa.h
hw/lm832x.c
hw/lsi53c895a.c
hw/m48t59.c
hw/marvell_88w8618_audio.c
hw/max111x.c
hw/max7310.c
hw/mpcore.c
hw/musicpal.c
hw/ne2000.c
hw/pci.c
hw/pci.h
hw/pckbd.c
hw/pcnet.c
hw/piix_pci.c
hw/pl011.c
hw/pl022.c
hw/pl031.c
hw/pl050.c
hw/pl061.c
hw/pl080.c
hw/pl110.c
hw/pl181.c
hw/pl190.c
hw/pxa2xx.c
hw/qdev.c
hw/qdev.h
hw/realview_gic.c
hw/rtl8139.c
hw/sbi.c
hw/slavio_intctl.c
hw/slavio_misc.c
hw/slavio_timer.c
hw/smbus.c
hw/smbus.h
hw/smbus_eeprom.c
hw/smc91c111.c
hw/sparc32_dma.c
hw/spitz.c
hw/ssd0303.c
hw/ssd0323.c
hw/ssi-sd.c
hw/ssi.c
hw/ssi.h
hw/stellaris.c
hw/stellaris_enet.c
hw/sun4c_intctl.c
hw/sun4m.c
hw/sun4u.c
hw/syborg_fb.c
hw/syborg_interrupt.c
hw/syborg_keyboard.c
hw/syborg_pointer.c
hw/syborg_rtc.c
hw/syborg_serial.c
hw/syborg_timer.c
hw/syborg_virtio.c
hw/sysbus.c
hw/sysbus.h
hw/tcx.c
hw/tmp105.c
hw/tosa.c
hw/twl92230.c
hw/unin_pci.c
hw/versatile_pci.c
hw/versatilepb.c
hw/vga.c
hw/virtio-pci.c
hw/vmware_vga.c
hw/wdt_i6300esb.c
hw/wdt_ib700.c
hw/wm8750.c
hw/xilinx_ethlite.c
hw/xilinx_intc.c
hw/xilinx_timer.c
hw/xilinx_uartlite.c