Patchwork [03/14] qdev: push id into qdev_create calls

login
register
mail settings
Submitter Anthony Liguori
Date Sept. 16, 2011, 4 p.m.
Message ID <1316188834-13675-4-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/114990/
State New
Headers show

Comments

Anthony Liguori - Sept. 16, 2011, 4 p.m.
This is preparation for enforcing an "all devices must have unique names" rule
which is one of the fundamental gaps between QOM and qdev.  This is a mechanical
conversion other than a few manual changes in qdev.c to introduce the new
parameter.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/apb_pci.c         |    2 +-
 hw/arm11mpcore.c     |    2 +-
 hw/arm_sysctl.c      |    2 +-
 hw/armv7m.c          |    6 +++---
 hw/axis_dev88.c      |    2 +-
 hw/bonito.c          |    2 +-
 hw/empty_slot.c      |    2 +-
 hw/escc.c            |    4 ++--
 hw/esp.c             |    2 +-
 hw/etraxfs.h         |    2 +-
 hw/fdc.c             |    4 ++--
 hw/fw_cfg.c          |    2 +-
 hw/grackle_pci.c     |    2 +-
 hw/grlib.h           |    6 +++---
 hw/gt64xxx.c         |    2 +-
 hw/i2c.c             |    2 +-
 hw/ide/qdev.c        |    2 +-
 hw/integratorcp.c    |    2 +-
 hw/intel-hda.c       |    2 +-
 hw/isa-bus.c         |    6 +++---
 hw/lan9118.c         |    2 +-
 hw/lm32.h            |    4 ++--
 hw/m48t59.c          |    2 +-
 hw/milkymist-hw.h    |   22 +++++++++++-----------
 hw/mips_jazz.c       |    4 ++--
 hw/mips_mipssim.c    |    2 +-
 hw/musicpal.c        |    4 ++--
 hw/nand.c            |    2 +-
 hw/nseries.c         |    4 ++--
 hw/omap1.c           |    2 +-
 hw/omap2.c           |    2 +-
 hw/pc.c              |    2 +-
 hw/pc_piix.c         |    2 +-
 hw/pci.c             |    4 ++--
 hw/piix_pci.c        |    2 +-
 hw/pxa2xx.c          |    2 +-
 hw/pxa2xx_dma.c      |    4 ++--
 hw/pxa2xx_gpio.c     |    2 +-
 hw/pxa2xx_pic.c      |    2 +-
 hw/qdev.c            |   19 ++++++++-----------
 hw/qdev.h            |    4 ++--
 hw/realview.c        |    4 ++--
 hw/s390-virtio-bus.c |    2 +-
 hw/s390-virtio.c     |    4 ++--
 hw/scsi-bus.c        |    2 +-
 hw/sm501.c           |    2 +-
 hw/smbus_eeprom.c    |    2 +-
 hw/smc91c111.c       |    2 +-
 hw/spapr_llan.c      |    2 +-
 hw/spapr_vio.c       |    2 +-
 hw/spapr_vscsi.c     |    2 +-
 hw/spapr_vty.c       |    2 +-
 hw/spitz.c           |    2 +-
 hw/ssi.c             |    2 +-
 hw/stellaris.c       |    2 +-
 hw/strongarm.c       |    4 ++--
 hw/sun4m.c           |   30 +++++++++++++++---------------
 hw/sun4u.c           |    4 ++--
 hw/syborg.c          |    4 ++--
 hw/sysbus.c          |    4 ++--
 hw/unin_pci.c        |    8 ++++----
 hw/usb-bus.c         |    2 +-
 hw/versatilepb.c     |    2 +-
 hw/vexpress.c        |    4 ++--
 hw/xilinx.h          |   10 +++++-----
 65 files changed, 125 insertions(+), 128 deletions(-)

Patch

diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index c232946..8661e15 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -326,7 +326,7 @@  PCIBus *pci_apb_init(target_phys_addr_t special_base,
     PCIBridge *br;
 
     /* Ultrasparc PBM main bus */
-    dev = qdev_create(NULL, "pbm");
+    dev = qdev_create(NULL, "pbm", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     /* apb_config */
diff --git a/hw/arm11mpcore.c b/hw/arm11mpcore.c
index 7d60ef6..0e456a2 100644
--- a/hw/arm11mpcore.c
+++ b/hw/arm11mpcore.c
@@ -67,7 +67,7 @@  static int realview_mpcore_init(SysBusDevice *dev)
     int n;
     int i;
 
-    priv = qdev_create(NULL, "arm11mpcore_priv");
+    priv = qdev_create(NULL, "arm11mpcore_priv", NULL);
     qdev_prop_set_uint32(priv, "num-cpu", s->num_cpu);
     qdev_init_nofail(priv);
     s->priv = sysbus_from_qdev(priv);
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index 17cf6f7..9a408ce 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -379,7 +379,7 @@  void arm_sysctl_init(uint32_t base, uint32_t sys_id, uint32_t proc_id)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "realview_sysctl");
+    dev = qdev_create(NULL, "realview_sysctl", NULL);
     qdev_prop_set_uint32(dev, "sys_id", sys_id);
     qdev_init_nofail(dev);
     qdev_prop_set_uint32(dev, "proc_id", proc_id);
diff --git a/hw/armv7m.c b/hw/armv7m.c
index 28d41b8..518379b 100644
--- a/hw/armv7m.c
+++ b/hw/armv7m.c
@@ -134,12 +134,12 @@  static void armv7m_bitband_init(void)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "ARM,bitband-memory");
+    dev = qdev_create(NULL, "ARM,bitband-memory", NULL);
     qdev_prop_set_uint32(dev, "base", 0x20000000);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0x22000000);
 
-    dev = qdev_create(NULL, "ARM,bitband-memory");
+    dev = qdev_create(NULL, "ARM,bitband-memory", NULL);
     qdev_prop_set_uint32(dev, "base", 0x40000000);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0x42000000);
@@ -205,7 +205,7 @@  qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
     memory_region_add_subregion(address_space_mem, 0x20000000, sram);
     armv7m_bitband_init();
 
-    nvic = qdev_create(NULL, "armv7m_nvic");
+    nvic = qdev_create(NULL, "armv7m_nvic", NULL);
     env->nvic = nvic;
     qdev_init_nofail(nvic);
     cpu_pic = arm_pic_init_cpu(env);
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 73eb39d..752c573 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -294,7 +294,7 @@  void axisdev88_init (ram_addr_t ram_size,
 
 
     cpu_irq = cris_pic_init_cpu(env);
-    dev = qdev_create(NULL, "etraxfs,pic");
+    dev = qdev_create(NULL, "etraxfs,pic", NULL);
     /* FIXME: Is there a proper way to signal vectors to the CPU core?  */
     qdev_prop_set_ptr(dev, "interrupt_vector", &env->interrupt_vector);
     qdev_init_nofail(dev);
diff --git a/hw/bonito.c b/hw/bonito.c
index fdb8198..d079833 100644
--- a/hw/bonito.c
+++ b/hw/bonito.c
@@ -771,7 +771,7 @@  PCIBus *bonito_init(qemu_irq *pic)
     PCIBonitoState *s;
     PCIDevice *d;
 
-    dev = qdev_create(NULL, "Bonito-pcihost");
+    dev = qdev_create(NULL, "Bonito-pcihost", NULL);
     pcihost = FROM_SYSBUS(BonitoState, sysbus_from_qdev(dev));
     b = pci_register_bus(&pcihost->busdev.qdev, "pci", pci_bonito_set_irq,
                          pci_bonito_map_irq, pic, get_system_memory(),
diff --git a/hw/empty_slot.c b/hw/empty_slot.c
index da8adc4..7a14d65 100644
--- a/hw/empty_slot.c
+++ b/hw/empty_slot.c
@@ -59,7 +59,7 @@  void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size)
         SysBusDevice *s;
         EmptySlot *e;
 
-        dev = qdev_create(NULL, "empty_slot");
+        dev = qdev_create(NULL, "empty_slot", NULL);
         s = sysbus_from_qdev(dev);
         e = FROM_SYSBUS(EmptySlot, s);
         e->size = slot_size;
diff --git a/hw/escc.c b/hw/escc.c
index 13c7e66..1e6bfb8 100644
--- a/hw/escc.c
+++ b/hw/escc.c
@@ -691,7 +691,7 @@  MemoryRegion *escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB,
     SysBusDevice *s;
     SerialState *d;
 
-    dev = qdev_create(NULL, "escc");
+    dev = qdev_create(NULL, "escc", NULL);
     qdev_prop_set_uint32(dev, "disabled", 0);
     qdev_prop_set_uint32(dev, "frequency", clock);
     qdev_prop_set_uint32(dev, "it_shift", it_shift);
@@ -852,7 +852,7 @@  void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "escc");
+    dev = qdev_create(NULL, "escc", NULL);
     qdev_prop_set_uint32(dev, "disabled", disabled);
     qdev_prop_set_uint32(dev, "frequency", clock);
     qdev_prop_set_uint32(dev, "it_shift", it_shift);
diff --git a/hw/esp.c b/hw/esp.c
index ca41f80..5e48578 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -714,7 +714,7 @@  void esp_init(target_phys_addr_t espaddr, int it_shift,
     SysBusDevice *s;
     ESPState *esp;
 
-    dev = qdev_create(NULL, "esp");
+    dev = qdev_create(NULL, "esp", NULL);
     esp = DO_UPCAST(ESPState, busdev.qdev, dev);
     esp->dma_memory_read = dma_memory_read;
     esp->dma_memory_write = dma_memory_write;
diff --git a/hw/etraxfs.h b/hw/etraxfs.h
index 1554b0b..69e2617 100644
--- a/hw/etraxfs.h
+++ b/hw/etraxfs.h
@@ -34,7 +34,7 @@  etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr,
     DeviceState *dev;
     qemu_check_nic_model(nd, "fseth");
 
-    dev = qdev_create(NULL, "etraxfs-eth");
+    dev = qdev_create(NULL, "etraxfs-eth", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "phyaddr", phyaddr);
     qdev_prop_set_ptr(dev, "dma_out", dma_out);
diff --git a/hw/fdc.c b/hw/fdc.c
index 433af73..4c7bd04 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1825,7 +1825,7 @@  void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
     DeviceState *dev;
     FDCtrlSysBus *sys;
 
-    dev = qdev_create(NULL, "sysbus-fdc");
+    dev = qdev_create(NULL, "sysbus-fdc", NULL);
     sys = DO_UPCAST(FDCtrlSysBus, busdev.qdev, dev);
     fdctrl = &sys->state;
     fdctrl->dma_chann = dma_chann; /* FIXME */
@@ -1846,7 +1846,7 @@  void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
     DeviceState *dev;
     FDCtrlSysBus *sys;
 
-    dev = qdev_create(NULL, "SUNW,fdtwo");
+    dev = qdev_create(NULL, "SUNW,fdtwo", NULL);
     if (fds[0]) {
         qdev_prop_set_drive_nofail(dev, "drive", fds[0]->bdrv);
     }
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index 8df265c..e2193d5 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -484,7 +484,7 @@  FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
     SysBusDevice *d;
     FWCfgState *s;
 
-    dev = qdev_create(NULL, "fw_cfg");
+    dev = qdev_create(NULL, "fw_cfg", NULL);
     qdev_prop_set_uint32(dev, "ctl_iobase", ctl_port);
     qdev_prop_set_uint32(dev, "data_iobase", data_port);
     qdev_init_nofail(dev);
diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c
index 9d3ff7d..4b2146d 100644
--- a/hw/grackle_pci.c
+++ b/hw/grackle_pci.c
@@ -69,7 +69,7 @@  PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic,
     SysBusDevice *s;
     GrackleState *d;
 
-    dev = qdev_create(NULL, "grackle");
+    dev = qdev_create(NULL, "grackle", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     d = FROM_SYSBUS(GrackleState, s);
diff --git a/hw/grlib.h b/hw/grlib.h
index fdf4b11..d02b64c 100644
--- a/hw/grlib.h
+++ b/hw/grlib.h
@@ -51,7 +51,7 @@  DeviceState *grlib_irqmp_create(target_phys_addr_t   base,
 
     assert(cpu_irqs != NULL);
 
-    dev = qdev_create(NULL, "grlib,irqmp");
+    dev = qdev_create(NULL, "grlib,irqmp", NULL);
     qdev_prop_set_ptr(dev, "set_pil_in", set_pil_in);
     qdev_prop_set_ptr(dev, "set_pil_in_opaque", env);
 
@@ -82,7 +82,7 @@  DeviceState *grlib_gptimer_create(target_phys_addr_t  base,
     DeviceState *dev;
     int i;
 
-    dev = qdev_create(NULL, "grlib,gptimer");
+    dev = qdev_create(NULL, "grlib,gptimer", NULL);
     qdev_prop_set_uint32(dev, "nr-timers", nr_timers);
     qdev_prop_set_uint32(dev, "frequency", freq);
     qdev_prop_set_uint32(dev, "irq-line", base_irq);
@@ -109,7 +109,7 @@  DeviceState *grlib_apbuart_create(target_phys_addr_t  base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "grlib,apbuart");
+    dev = qdev_create(NULL, "grlib,apbuart", NULL);
     qdev_prop_set_chr(dev, "chrdev", serial);
 
     if (qdev_init(dev)) {
diff --git a/hw/gt64xxx.c b/hw/gt64xxx.c
index 1c34253..85d969f 100644
--- a/hw/gt64xxx.c
+++ b/hw/gt64xxx.c
@@ -1086,7 +1086,7 @@  PCIBus *gt64120_register(qemu_irq *pic)
     GT64120State *d;
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "gt64120");
+    dev = qdev_create(NULL, "gt64120", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     d = FROM_SYSBUS(GT64120State, s);
diff --git a/hw/i2c.c b/hw/i2c.c
index 49b9ecb..e2ba194 100644
--- a/hw/i2c.c
+++ b/hw/i2c.c
@@ -189,7 +189,7 @@  DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr)
 {
     DeviceState *dev;
 
-    dev = qdev_create(&bus->qbus, name);
+    dev = qdev_create(&bus->qbus, name, NULL);
     qdev_prop_set_uint8(dev, "address", addr);
     qdev_init_nofail(dev);
     return dev;
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 4207127..8c868b5 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -102,7 +102,7 @@  IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive)
 {
     DeviceState *dev;
 
-    dev = qdev_create(&bus->qbus, drive->media_cd ? "ide-cd" : "ide-hd");
+    dev = qdev_create(&bus->qbus, drive->media_cd ? "ide-cd" : "ide-hd", NULL);
     qdev_prop_set_uint32(dev, "unit", unit);
     qdev_prop_set_drive_nofail(dev, "drive", drive->bdrv);
     qdev_init_nofail(dev);
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 9a289b4..34ead1b 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -495,7 +495,7 @@  static void integratorcp_init(ram_addr_t ram_size,
     memory_region_init_alias(ram_alias, "ram.alias", ram, 0, ram_size);
     memory_region_add_subregion(address_space_mem, 0x80000000, ram_alias);
 
-    dev = qdev_create(NULL, "integrator_core");
+    dev = qdev_create(NULL, "integrator_core", NULL);
     qdev_prop_set_uint32(dev, "memsz", ram_size >> 20);
     qdev_init_nofail(dev);
     sysbus_mmio_map((SysBusDevice *)dev, 0, 0x10000000);
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 4272204..1ee2527 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -1280,7 +1280,7 @@  int intel_hda_and_codec_init(PCIBus *bus)
 
     controller = pci_create_simple(bus, -1, "intel-hda");
     hdabus = QLIST_FIRST(&controller->qdev.child_bus);
-    codec = qdev_create(hdabus, "hda-duplex");
+    codec = qdev_create(hdabus, "hda-duplex", NULL);
     qdev_init_nofail(codec);
     return 0;
 }
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 1cb497f..31d4d01 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -46,7 +46,7 @@  ISABus *isa_bus_new(DeviceState *dev)
         return NULL;
     }
     if (NULL == dev) {
-        dev = qdev_create(NULL, "isabus-bridge");
+        dev = qdev_create(NULL, "isabus-bridge", NULL);
         qdev_init_nofail(dev);
     }
 
@@ -132,7 +132,7 @@  ISADevice *isa_create(const char *name)
         hw_error("Tried to create isa device %s with no isa bus present.",
                  name);
     }
-    dev = qdev_create(&isabus->qbus, name);
+    dev = qdev_create(&isabus->qbus, name, NULL);
     return DO_UPCAST(ISADevice, qdev, dev);
 }
 
@@ -144,7 +144,7 @@  ISADevice *isa_try_create(const char *name)
         hw_error("Tried to create isa device %s with no isa bus present.",
                  name);
     }
-    dev = qdev_try_create(&isabus->qbus, name);
+    dev = qdev_try_create(&isabus->qbus, name, NULL);
     return DO_UPCAST(ISADevice, qdev, dev);
 }
 
diff --git a/hw/lan9118.c b/hw/lan9118.c
index 73a8661..83963ea 100644
--- a/hw/lan9118.c
+++ b/hw/lan9118.c
@@ -1185,7 +1185,7 @@  void lan9118_init(NICInfo *nd, uint32_t base, qemu_irq irq)
     SysBusDevice *s;
 
     qemu_check_nic_model(nd, "lan9118");
-    dev = qdev_create(NULL, "lan9118");
+    dev = qdev_create(NULL, "lan9118", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
diff --git a/hw/lm32.h b/hw/lm32.h
index 0a67632..bb9538b 100644
--- a/hw/lm32.h
+++ b/hw/lm32.h
@@ -6,7 +6,7 @@  static inline DeviceState *lm32_pic_init(qemu_irq cpu_irq)
     DeviceState *dev;
     SysBusDevice *d;
 
-    dev = qdev_create(NULL, "lm32-pic");
+    dev = qdev_create(NULL, "lm32-pic", NULL);
     qdev_init_nofail(dev);
     d = sysbus_from_qdev(dev);
     sysbus_connect_irq(d, 0, cpu_irq);
@@ -18,7 +18,7 @@  static inline DeviceState *lm32_juart_init(void)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "lm32-juart");
+    dev = qdev_create(NULL, "lm32-juart", NULL);
     qdev_init_nofail(dev);
 
     return dev;
diff --git a/hw/m48t59.c b/hw/m48t59.c
index 0cc361e..50927b7 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -635,7 +635,7 @@  M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
     M48t59SysBusState *d;
     M48t59State *state;
 
-    dev = qdev_create(NULL, "m48t59");
+    dev = qdev_create(NULL, "m48t59", NULL);
     qdev_prop_set_uint32(dev, "type", type);
     qdev_prop_set_uint32(dev, "size", size);
     qdev_prop_set_uint32(dev, "io_base", io_base);
diff --git a/hw/milkymist-hw.h b/hw/milkymist-hw.h
index 20de68e..ce556ff 100644
--- a/hw/milkymist-hw.h
+++ b/hw/milkymist-hw.h
@@ -9,7 +9,7 @@  static inline DeviceState *milkymist_uart_create(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-uart");
+    dev = qdev_create(NULL, "milkymist-uart", NULL);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
     sysbus_connect_irq(sysbus_from_qdev(dev), 0, rx_irq);
@@ -22,7 +22,7 @@  static inline DeviceState *milkymist_hpdmc_create(target_phys_addr_t base)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-hpdmc");
+    dev = qdev_create(NULL, "milkymist-hpdmc", NULL);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
 
@@ -33,7 +33,7 @@  static inline DeviceState *milkymist_memcard_create(target_phys_addr_t base)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-memcard");
+    dev = qdev_create(NULL, "milkymist-memcard", NULL);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
 
@@ -45,7 +45,7 @@  static inline DeviceState *milkymist_vgafb_create(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-vgafb");
+    dev = qdev_create(NULL, "milkymist-vgafb", NULL);
     qdev_prop_set_uint32(dev, "fb_offset", fb_offset);
     qdev_prop_set_uint32(dev, "fb_mask", fb_mask);
     qdev_init_nofail(dev);
@@ -61,7 +61,7 @@  static inline DeviceState *milkymist_sysctl_create(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-sysctl");
+    dev = qdev_create(NULL, "milkymist-sysctl", NULL);
     qdev_prop_set_uint32(dev, "frequency", freq_hz);
     qdev_prop_set_uint32(dev, "systemid", system_id);
     qdev_prop_set_uint32(dev, "capabilities", capabilities);
@@ -80,7 +80,7 @@  static inline DeviceState *milkymist_pfpu_create(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-pfpu");
+    dev = qdev_create(NULL, "milkymist-pfpu", NULL);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
     sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
@@ -142,7 +142,7 @@  static inline DeviceState *milkymist_tmu2_create(target_phys_addr_t base,
     XFree(configs);
     XCloseDisplay(d);
 
-    dev = qdev_create(NULL, "milkymist-tmu2");
+    dev = qdev_create(NULL, "milkymist-tmu2", NULL);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
     sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
@@ -159,7 +159,7 @@  static inline DeviceState *milkymist_ac97_create(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-ac97");
+    dev = qdev_create(NULL, "milkymist-ac97", NULL);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
     sysbus_connect_irq(sysbus_from_qdev(dev), 0, crrequest_irq);
@@ -176,7 +176,7 @@  static inline DeviceState *milkymist_minimac_create(target_phys_addr_t base,
     DeviceState *dev;
 
     qemu_check_nic_model(&nd_table[0], "minimac");
-    dev = qdev_create(NULL, "milkymist-minimac");
+    dev = qdev_create(NULL, "milkymist-minimac", NULL);
     qdev_set_nic_properties(dev, &nd_table[0]);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
@@ -192,7 +192,7 @@  static inline DeviceState *milkymist_minimac2_create(target_phys_addr_t base,
     DeviceState *dev;
 
     qemu_check_nic_model(&nd_table[0], "minimac2");
-    dev = qdev_create(NULL, "milkymist-minimac2");
+    dev = qdev_create(NULL, "milkymist-minimac2", NULL);
     qdev_prop_set_taddr(dev, "buffers_base", buffers_base);
     qdev_set_nic_properties(dev, &nd_table[0]);
     qdev_init_nofail(dev);
@@ -209,7 +209,7 @@  static inline DeviceState *milkymist_softusb_create(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "milkymist-softusb");
+    dev = qdev_create(NULL, "milkymist-softusb", NULL);
     qdev_prop_set_uint32(dev, "pmem_base", pmem_base);
     qdev_prop_set_uint32(dev, "pmem_size", pmem_size);
     qdev_prop_set_uint32(dev, "dmem_base", dmem_base);
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index f3c9f93..315886b 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -195,7 +195,7 @@  void mips_jazz_init (ram_addr_t ram_size,
     /* Video card */
     switch (jazz_model) {
     case JAZZ_MAGNUM:
-        dev = qdev_create(NULL, "sysbus-g364");
+        dev = qdev_create(NULL, "sysbus-g364", NULL);
         qdev_init_nofail(dev);
         sysbus = sysbus_from_qdev(dev);
         sysbus_mmio_map(sysbus, 0, 0x60080000);
@@ -284,7 +284,7 @@  void mips_jazz_init (ram_addr_t ram_size,
     audio_init(i8259, NULL);
 
     /* NVRAM */
-    dev = qdev_create(NULL, "ds1225y");
+    dev = qdev_create(NULL, "ds1225y", NULL);
     qdev_init_nofail(dev);
     sysbus = sysbus_from_qdev(dev);
     sysbus_mmio_map(sysbus, 0, 0x80009000);
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index ac65555..e684e8a 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -119,7 +119,7 @@  static void mipsnet_init(int base, qemu_irq irq, NICInfo *nd)
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "mipsnet");
+    dev = qdev_create(NULL, "mipsnet", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_init_nofail(dev);
 
diff --git a/hw/musicpal.c b/hw/musicpal.c
index ade5a91..f204bff 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1586,7 +1586,7 @@  static void musicpal_init(ram_addr_t ram_size,
     sysbus_create_simple("mv88w8618_flashcfg", MP_FLASHCFG_BASE, NULL);
 
     qemu_check_nic_model(&nd_table[0], "mv88w8618");
-    dev = qdev_create(NULL, "mv88w8618_eth");
+    dev = qdev_create(NULL, "mv88w8618_eth", NULL);
     qdev_set_nic_properties(dev, &nd_table[0]);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, MP_ETH_BASE);
@@ -1622,7 +1622,7 @@  static void musicpal_init(ram_addr_t ram_size,
     }
 
     wm8750_dev = i2c_create_slave(i2c, "wm8750", MP_WM_ADDR);
-    dev = qdev_create(NULL, "mv88w8618_audio");
+    dev = qdev_create(NULL, "mv88w8618_audio", NULL);
     s = sysbus_from_qdev(dev);
     qdev_prop_set_ptr(dev, "wm8750", wm8750_dev);
     qdev_init_nofail(dev);
diff --git a/hw/nand.c b/hw/nand.c
index c27783e..2069439 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -604,7 +604,7 @@  DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id)
     if (nand_flash_ids[chip_id].size == 0) {
         hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__);
     }
-    dev = qdev_create(NULL, "nand");
+    dev = qdev_create(NULL, "nand", NULL);
     qdev_prop_set_uint8(dev, "manufacturer_id", manf_id);
     qdev_prop_set_uint8(dev, "chip_id", chip_id);
     if (bdrv) {
diff --git a/hw/nseries.c b/hw/nseries.c
index af287dd..14dc0be 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -167,7 +167,7 @@  static void n8x0_nand_setup(struct n800_s *s)
     char *otp_region;
     DriveInfo *dinfo;
 
-    s->nand = qdev_create(NULL, "onenand");
+    s->nand = qdev_create(NULL, "onenand", NULL);
     qdev_prop_set_uint16(s->nand, "manufacturer_id", NAND_MFR_SAMSUNG);
     /* Either 0x40 or 0x48 are OK for the device ID */
     qdev_prop_set_uint16(s->nand, "device_id", 0x48);
@@ -767,7 +767,7 @@  static void n8x0_uart_setup(struct n800_s *s)
 static void n8x0_usb_setup(struct n800_s *s)
 {
     SysBusDevice *dev;
-    s->usb = qdev_create(NULL, "tusb6010");
+    s->usb = qdev_create(NULL, "tusb6010", NULL);
     dev = sysbus_from_qdev(s->usb);
     qdev_init_nofail(s->usb);
     sysbus_connect_irq(dev, 0,
diff --git a/hw/omap1.c b/hw/omap1.c
index 614fd31..c2dc173 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -3845,7 +3845,7 @@  struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
                     s->irq[1][OMAP_INT_KEYBOARD], s->irq[1][OMAP_INT_MPUIO],
                     s->wakeup, omap_findclk(s, "clk32-kHz"));
 
-    s->gpio = qdev_create(NULL, "omap-gpio");
+    s->gpio = qdev_create(NULL, "omap-gpio", NULL);
     qdev_prop_set_int32(s->gpio, "mpu_model", s->mpu_model);
     qdev_init_nofail(s->gpio);
     sysbus_connect_irq(sysbus_from_qdev(s->gpio), 0,
diff --git a/hw/omap2.c b/hw/omap2.c
index ca088d9..96533b6 100644
--- a/hw/omap2.c
+++ b/hw/omap2.c
@@ -2378,7 +2378,7 @@  struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size,
                     omap_findclk(s, "i2c2.fclk"),
                     omap_findclk(s, "i2c2.iclk"));
 
-    s->gpio = qdev_create(NULL, "omap2-gpio");
+    s->gpio = qdev_create(NULL, "omap2-gpio", NULL);
     qdev_prop_set_int32(s->gpio, "mpu_model", s->mpu_model);
     qdev_prop_set_ptr(s->gpio, "iclk", omap_findclk(s, "gpio_iclk"));
     qdev_prop_set_ptr(s->gpio, "fclk0", omap_findclk(s, "gpio1_dbclk"));
diff --git a/hw/pc.c b/hw/pc.c
index f0f7db0..236f742 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -875,7 +875,7 @@  static DeviceState *apic_init(void *env, uint8_t apic_id)
     SysBusDevice *d;
     static int apic_mapped;
 
-    dev = qdev_create(NULL, "apic");
+    dev = qdev_create(NULL, "apic", NULL);
     qdev_prop_set_uint8(dev, "index", apic_id);
     qdev_prop_set_ptr(dev, "cpu_env", env);
     qdev_init_nofail(dev);
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 75d96d9..960589a 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -59,7 +59,7 @@  static void ioapic_init(IsaIrqState *isa_irq_state)
     SysBusDevice *d;
     unsigned int i;
 
-    dev = qdev_create(NULL, "ioapic");
+    dev = qdev_create(NULL, "ioapic", NULL);
     qdev_init_nofail(dev);
     d = sysbus_from_qdev(dev);
     sysbus_mmio_map(d, 0, 0xfec00000);
diff --git a/hw/pci.c b/hw/pci.c
index af74003..67efbb2 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1723,7 +1723,7 @@  PCIDevice *pci_create_multifunction(PCIBus *bus, int devfn, bool multifunction,
 {
     DeviceState *dev;
 
-    dev = qdev_create(&bus->qbus, name);
+    dev = qdev_create(&bus->qbus, name, NULL);
     qdev_prop_set_uint32(dev, "addr", devfn);
     qdev_prop_set_bit(dev, "multifunction", multifunction);
     return DO_UPCAST(PCIDevice, qdev, dev);
@@ -1735,7 +1735,7 @@  PCIDevice *pci_try_create_multifunction(PCIBus *bus, int devfn,
 {
     DeviceState *dev;
 
-    dev = qdev_try_create(&bus->qbus, name);
+    dev = qdev_try_create(&bus->qbus, name, NULL);
     if (!dev) {
         return NULL;
     }
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 8f6ea42..14ebcee 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -281,7 +281,7 @@  static PCIBus *i440fx_common_init(const char *device_name,
     PIIX3State *piix3;
     PCII440FXState *f;
 
-    dev = qdev_create(NULL, "i440FX-pcihost");
+    dev = qdev_create(NULL, "i440FX-pcihost", NULL);
     s = FROM_SYSBUS(I440FXState, sysbus_from_qdev(dev));
     s->address_space = address_space_mem;
     b = pci_bus_new(&s->busdev.qdev, NULL, pci_address_space,
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 2aa8760..82538dd 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -1514,7 +1514,7 @@  PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
     SysBusDevice *i2c_dev;
     PXA2xxI2CState *s;
 
-    i2c_dev = sysbus_from_qdev(qdev_create(NULL, "pxa2xx_i2c"));
+    i2c_dev = sysbus_from_qdev(qdev_create(NULL, "pxa2xx_i2c", NULL));
     qdev_prop_set_uint32(&i2c_dev->qdev, "size", region_size + 1);
     qdev_prop_set_uint32(&i2c_dev->qdev, "offset",
             base - (base & (~region_size) & TARGET_PAGE_MASK));
diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c
index 07ec2db..ba22860 100644
--- a/hw/pxa2xx_dma.c
+++ b/hw/pxa2xx_dma.c
@@ -483,7 +483,7 @@  DeviceState *pxa27x_dma_init(target_phys_addr_t base, qemu_irq irq)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "pxa2xx-dma");
+    dev = qdev_create(NULL, "pxa2xx-dma", NULL);
     qdev_prop_set_int32(dev, "channels", PXA27X_DMA_NUM_CHANNELS);
     qdev_init_nofail(dev);
 
@@ -497,7 +497,7 @@  DeviceState *pxa255_dma_init(target_phys_addr_t base, qemu_irq irq)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "pxa2xx-dma");
+    dev = qdev_create(NULL, "pxa2xx-dma", NULL);
     qdev_prop_set_int32(dev, "channels", PXA27X_DMA_NUM_CHANNELS);
     qdev_init_nofail(dev);
 
diff --git a/hw/pxa2xx_gpio.c b/hw/pxa2xx_gpio.c
index 200b0cf..b1433f0 100644
--- a/hw/pxa2xx_gpio.c
+++ b/hw/pxa2xx_gpio.c
@@ -257,7 +257,7 @@  DeviceState *pxa2xx_gpio_init(target_phys_addr_t base,
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "pxa2xx-gpio");
+    dev = qdev_create(NULL, "pxa2xx-gpio", NULL);
     qdev_prop_set_int32(dev, "lines", lines);
     qdev_prop_set_int32(dev, "ncpu", env->cpu_index);
     qdev_init_nofail(dev);
diff --git a/hw/pxa2xx_pic.c b/hw/pxa2xx_pic.c
index bdd82e6..d69aee9 100644
--- a/hw/pxa2xx_pic.c
+++ b/hw/pxa2xx_pic.c
@@ -251,7 +251,7 @@  static int pxa2xx_pic_post_load(void *opaque, int version_id)
 
 DeviceState *pxa2xx_pic_init(target_phys_addr_t base, CPUState *env)
 {
-    DeviceState *dev = qdev_create(NULL, "pxa2xx_pic");
+    DeviceState *dev = qdev_create(NULL, "pxa2xx_pic", NULL);
     int iomemtype;
     PXA2xxPICState *s = FROM_SYSBUS(PXA2xxPICState, sysbus_from_qdev(dev));
 
diff --git a/hw/qdev.c b/hw/qdev.c
index 0e267a7..aeebdb9 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -88,7 +88,7 @@  static DeviceInfo *qdev_find_info(BusInfo *bus_info, const char *name)
     return NULL;
 }
 
-static DeviceState *qdev_create_from_info(BusState *bus, DeviceInfo *info)
+static DeviceState *qdev_create_from_info(BusState *bus, DeviceInfo *info, const char *id)
 {
     DeviceState *dev;
 
@@ -107,17 +107,18 @@  static DeviceState *qdev_create_from_info(BusState *bus, DeviceInfo *info)
     }
     dev->instance_id_alias = -1;
     dev->state = DEV_STATE_CREATED;
+    dev->id = id;
     return dev;
 }
 
 /* Create a new device.  This only initializes the device state structure
    and allows properties to be set.  qdev_init should be called to
    initialize the actual device emulation.  */
-DeviceState *qdev_create(BusState *bus, const char *name)
+DeviceState *qdev_create(BusState *bus, const char *name, const char *id)
 {
     DeviceState *dev;
 
-    dev = qdev_try_create(bus, name);
+    dev = qdev_try_create(bus, name, id);
     if (!dev) {
         if (bus) {
             hw_error("Unknown device '%s' for bus '%s'\n", name,
@@ -130,7 +131,7 @@  DeviceState *qdev_create(BusState *bus, const char *name)
     return dev;
 }
 
-DeviceState *qdev_try_create(BusState *bus, const char *name)
+DeviceState *qdev_try_create(BusState *bus, const char *name, const char *id)
 {
     DeviceInfo *info;
 
@@ -143,7 +144,7 @@  DeviceState *qdev_try_create(BusState *bus, const char *name)
         return NULL;
     }
 
-    return qdev_create_from_info(bus, info);
+    return qdev_create_from_info(bus, info, id);
 }
 
 static void qdev_print_devinfo(DeviceInfo *info)
@@ -226,7 +227,7 @@  int qdev_device_help(QemuOpts *opts)
 
 DeviceState *qdev_device_add(QemuOpts *opts)
 {
-    const char *driver, *path, *id;
+    const char *driver, *path;
     DeviceInfo *info;
     DeviceState *qdev;
     BusState *bus;
@@ -271,11 +272,7 @@  DeviceState *qdev_device_add(QemuOpts *opts)
     }
 
     /* create device, set properties */
-    qdev = qdev_create_from_info(bus, info);
-    id = qemu_opts_id(opts);
-    if (id) {
-        qdev->id = id;
-    }
+    qdev = qdev_create_from_info(bus, info, qemu_opts_id(opts));
     if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {
         qdev_free(qdev);
         return NULL;
diff --git a/hw/qdev.h b/hw/qdev.h
index 8a13ec9..626a1b6 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -121,8 +121,8 @@  typedef struct GlobalProperty {
 
 /*** Board API.  This should go away once we have a machine config file.  ***/
 
-DeviceState *qdev_create(BusState *bus, const char *name);
-DeviceState *qdev_try_create(BusState *bus, const char *name);
+DeviceState *qdev_create(BusState *bus, const char *name, const char *id);
+DeviceState *qdev_try_create(BusState *bus, const char *name, const char *id);
 int qdev_device_help(QemuOpts *opts);
 DeviceState *qdev_device_add(QemuOpts *opts);
 int qdev_init(DeviceState *dev) QEMU_WARN_UNUSED_RESULT;
diff --git a/hw/realview.c b/hw/realview.c
index 549bb15..301739a 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -204,14 +204,14 @@  static void realview_init(ram_addr_t ram_size,
     }
 
     sys_id = is_pb ? 0x01780500 : 0xc1400400;
-    sysctl = qdev_create(NULL, "realview_sysctl");
+    sysctl = qdev_create(NULL, "realview_sysctl", NULL);
     qdev_prop_set_uint32(sysctl, "sys_id", sys_id);
     qdev_init_nofail(sysctl);
     qdev_prop_set_uint32(sysctl, "proc_id", proc_id);
     sysbus_mmio_map(sysbus_from_qdev(sysctl), 0, 0x10000000);
 
     if (is_mpcore) {
-        dev = qdev_create(NULL, is_pb ? "a9mpcore_priv": "realview_mpcore");
+        dev = qdev_create(NULL, is_pb ? "a9mpcore_priv": "realview_mpcore", NULL);
         qdev_prop_set_uint32(dev, "num-cpu", smp_cpus);
         qdev_init_nofail(dev);
         busdev = sysbus_from_qdev(dev);
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index e2f3e32..2252b04 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -70,7 +70,7 @@  VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
     DeviceState *dev;
 
     /* Create bridge device */
-    dev = qdev_create(NULL, "s390-virtio-bridge");
+    dev = qdev_create(NULL, "s390-virtio-bridge", NULL);
     qdev_init_nofail(dev);
 
     /* Create bus on bridge device */
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index acbf026..5a954e0 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -255,7 +255,7 @@  static void s390_init(ram_addr_t my_ram_size,
             exit(1);
         }
 
-        dev = qdev_create((BusState *)s390_bus, "virtio-net-s390");
+        dev = qdev_create((BusState *)s390_bus, "virtio-net-s390", NULL);
         qdev_set_nic_properties(dev, nd);
         qdev_init_nofail(dev);
     }
@@ -270,7 +270,7 @@  static void s390_init(ram_addr_t my_ram_size,
             continue;
         }
 
-        dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390");
+        dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390", NULL);
         qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
         qdev_init_nofail(dev);
     }
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 0248294..459d54c 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -99,7 +99,7 @@  SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv,
     DeviceState *dev;
 
     driver = bdrv_is_sg(bdrv) ? "scsi-generic" : "scsi-disk";
-    dev = qdev_create(&bus->qbus, driver);
+    dev = qdev_create(&bus->qbus, driver, NULL);
     qdev_prop_set_uint32(dev, "scsi-id", unit);
     if (qdev_prop_exists(dev, "removable")) {
         qdev_prop_set_bit(dev, "removable", removable);
diff --git a/hw/sm501.c b/hw/sm501.c
index 1ed0a7e..c0f003c 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1430,7 +1430,7 @@  void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
                                  0x54, sm501_2d_engine_index);
 
     /* bridge to usb host emulation module */
-    dev = qdev_create(NULL, "sysbus-ohci");
+    dev = qdev_create(NULL, "sysbus-ohci", NULL);
     qdev_prop_set_uint32(dev, "num-ports", 2);
     qdev_prop_set_taddr(dev, "dma-offset", base);
     qdev_init_nofail(dev);
diff --git a/hw/smbus_eeprom.c b/hw/smbus_eeprom.c
index 5d080ab..ea7c123 100644
--- a/hw/smbus_eeprom.c
+++ b/hw/smbus_eeprom.c
@@ -137,7 +137,7 @@  void smbus_eeprom_init(i2c_bus *smbus, int nb_eeprom,
 
     for (i = 0; i < nb_eeprom; i++) {
         DeviceState *eeprom;
-        eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
+        eeprom = qdev_create((BusState *)smbus, "smbus-eeprom", NULL);
         qdev_prop_set_uint8(eeprom, "address", 0x50 + i);
         qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256));
         qdev_init_nofail(eeprom);
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index 3a8a85c..127ec91 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -786,7 +786,7 @@  void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)
     SysBusDevice *s;
 
     qemu_check_nic_model(nd, "smc91c111");
-    dev = qdev_create(NULL, "smc91c111");
+    dev = qdev_create(NULL, "smc91c111", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c
index c18efc7..76a3b71 100644
--- a/hw/spapr_llan.c
+++ b/hw/spapr_llan.c
@@ -201,7 +201,7 @@  void spapr_vlan_create(VIOsPAPRBus *bus, uint32_t reg, NICInfo *nd,
     DeviceState *dev;
     VIOsPAPRDevice *sdev;
 
-    dev = qdev_create(&bus->bus, "spapr-vlan");
+    dev = qdev_create(&bus->bus, "spapr-vlan", NULL);
     qdev_prop_set_uint32(dev, "reg", reg);
 
     qdev_set_nic_properties(dev, nd);
diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c
index ce6558b..cd2641b 100644
--- a/hw/spapr_vio.c
+++ b/hw/spapr_vio.c
@@ -649,7 +649,7 @@  VIOsPAPRBus *spapr_vio_bus_init(void)
     DeviceInfo *qinfo;
 
     /* Create bridge device */
-    dev = qdev_create(NULL, "spapr-vio-bridge");
+    dev = qdev_create(NULL, "spapr-vio-bridge", NULL);
     qdev_init_nofail(dev);
 
     /* Create bus on bridge device */
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c
index fc9ac6a..f2a8cc5 100644
--- a/hw/spapr_vscsi.c
+++ b/hw/spapr_vscsi.c
@@ -899,7 +899,7 @@  void spapr_vscsi_create(VIOsPAPRBus *bus, uint32_t reg,
     DeviceState *dev;
     VIOsPAPRDevice *sdev;
 
-    dev = qdev_create(&bus->bus, "spapr-vscsi");
+    dev = qdev_create(&bus->bus, "spapr-vscsi", NULL);
     qdev_prop_set_uint32(dev, "reg", reg);
 
     qdev_init_nofail(dev);
diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c
index f5046d9..08502c1 100644
--- a/hw/spapr_vty.c
+++ b/hw/spapr_vty.c
@@ -122,7 +122,7 @@  void spapr_vty_create(VIOsPAPRBus *bus,
     DeviceState *dev;
     VIOsPAPRDevice *sdev;
 
-    dev = qdev_create(&bus->bus, "spapr-vty");
+    dev = qdev_create(&bus->bus, "spapr-vty", NULL);
     qdev_prop_set_uint32(dev, "reg", reg);
     qdev_prop_set_chr(dev, "chardev", chardev);
     qdev_init_nofail(dev);
diff --git a/hw/spitz.c b/hw/spitz.c
index 0adae59..90183d4 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -154,7 +154,7 @@  static void sl_flash_register(PXA2xxState *cpu, int size)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "sl-nand");
+    dev = qdev_create(NULL, "sl-nand", NULL);
 
     qdev_prop_set_uint8(dev, "manf_id", NAND_MFR_SAMSUNG);
     if (size == FLASH_128M)
diff --git a/hw/ssi.c b/hw/ssi.c
index 3f4c5f9..c068aed 100644
--- a/hw/ssi.c
+++ b/hw/ssi.c
@@ -45,7 +45,7 @@  void ssi_register_slave(SSISlaveInfo *info)
 DeviceState *ssi_create_slave(SSIBus *bus, const char *name)
 {
     DeviceState *dev;
-    dev = qdev_create(&bus->qbus, name);
+    dev = qdev_create(&bus->qbus, name, NULL);
     qdev_init_nofail(dev);
     return dev;
 }
diff --git a/hw/stellaris.c b/hw/stellaris.c
index 2bf1c23..2345692 100644
--- a/hw/stellaris.c
+++ b/hw/stellaris.c
@@ -1350,7 +1350,7 @@  static void stellaris_init(const char *kernel_filename, const char *cpu_model,
 
         qemu_check_nic_model(&nd_table[0], "stellaris");
 
-        enet = qdev_create(NULL, "stellaris_enet");
+        enet = qdev_create(NULL, "stellaris_enet", NULL);
         qdev_set_nic_properties(enet, &nd_table[0]);
         qdev_init_nofail(enet);
         sysbus_mmio_map(sysbus_from_qdev(enet), 0, 0x40048000);
diff --git a/hw/strongarm.c b/hw/strongarm.c
index 6097ea2..2d98893 100644
--- a/hw/strongarm.c
+++ b/hw/strongarm.c
@@ -610,7 +610,7 @@  static DeviceState *strongarm_gpio_init(target_phys_addr_t base,
     DeviceState *dev;
     int i;
 
-    dev = qdev_create(NULL, "strongarm-gpio");
+    dev = qdev_create(NULL, "strongarm-gpio", NULL);
     qdev_init_nofail(dev);
 
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
@@ -1570,7 +1570,7 @@  StrongARMState *sa1110_init(unsigned int sdram_size, const char *rev)
     s->ppc = sysbus_create_varargs("strongarm-ppc", 0x90060000, NULL);
 
     for (i = 0; sa_serial[i].io_base; i++) {
-        DeviceState *dev = qdev_create(NULL, "strongarm-uart");
+        DeviceState *dev = qdev_create(NULL, "strongarm-uart", NULL);
         qdev_prop_set_chr(dev, "chardev", serial_hds[i]);
         qdev_init_nofail(dev);
         sysbus_mmio_map(sysbus_from_qdev(dev), 0,
diff --git a/hw/sun4m.c b/hw/sun4m.c
index dcaed38..ebf1dde 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -373,7 +373,7 @@  static void *iommu_init(target_phys_addr_t addr, uint32_t version, qemu_irq irq)
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "iommu");
+    dev = qdev_create(NULL, "iommu", NULL);
     qdev_prop_set_uint32(dev, "version", version);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
@@ -389,7 +389,7 @@  static void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "sparc32_dma");
+    dev = qdev_create(NULL, "sparc32_dma", NULL);
     qdev_prop_set_ptr(dev, "iommu_opaque", iommu);
     qdev_prop_set_uint32(dev, "is_ledma", is_ledma);
     qdev_init_nofail(dev);
@@ -410,7 +410,7 @@  static void lance_init(NICInfo *nd, target_phys_addr_t leaddr,
 
     qemu_check_nic_model(&nd_table[0], "lance");
 
-    dev = qdev_create(NULL, "lance");
+    dev = qdev_create(NULL, "lance", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_ptr(dev, "dma", dma_opaque);
     qdev_init_nofail(dev);
@@ -429,7 +429,7 @@  static DeviceState *slavio_intctl_init(target_phys_addr_t addr,
     SysBusDevice *s;
     unsigned int i, j;
 
-    dev = qdev_create(NULL, "slavio_intctl");
+    dev = qdev_create(NULL, "slavio_intctl", NULL);
     qdev_init_nofail(dev);
 
     s = sysbus_from_qdev(dev);
@@ -457,7 +457,7 @@  static void slavio_timer_init_all(target_phys_addr_t addr, qemu_irq master_irq,
     SysBusDevice *s;
     unsigned int i;
 
-    dev = qdev_create(NULL, "slavio_timer");
+    dev = qdev_create(NULL, "slavio_timer", NULL);
     qdev_prop_set_uint32(dev, "num_cpus", num_cpus);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
@@ -484,7 +484,7 @@  static void slavio_misc_init(target_phys_addr_t base,
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "slavio_misc");
+    dev = qdev_create(NULL, "slavio_misc", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     if (base) {
@@ -520,7 +520,7 @@  static void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "eccmemctl");
+    dev = qdev_create(NULL, "eccmemctl", NULL);
     qdev_prop_set_uint32(dev, "version", version);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
@@ -536,7 +536,7 @@  static void apc_init(target_phys_addr_t power_base, qemu_irq cpu_halt)
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "apc");
+    dev = qdev_create(NULL, "apc", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     /* Power management (APC) XXX: not a Slavio device */
@@ -550,7 +550,7 @@  static void tcx_init(target_phys_addr_t addr, int vram_size, int width,
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "SUNW,tcx");
+    dev = qdev_create(NULL, "SUNW,tcx", NULL);
     qdev_prop_set_taddr(dev, "addr", addr);
     qdev_prop_set_uint32(dev, "vram_size", vram_size);
     qdev_prop_set_uint16(dev, "width", width);
@@ -585,7 +585,7 @@  static void idreg_init(target_phys_addr_t addr)
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "macio_idreg");
+    dev = qdev_create(NULL, "macio_idreg", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
 
@@ -621,7 +621,7 @@  static void afx_init(target_phys_addr_t addr)
     DeviceState *dev;
     SysBusDevice *s;
 
-    dev = qdev_create(NULL, "tcx_afx");
+    dev = qdev_create(NULL, "tcx_afx", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
 
@@ -664,7 +664,7 @@  static void prom_init(target_phys_addr_t addr, const char *bios_name)
     char *filename;
     int ret;
 
-    dev = qdev_create(NULL, "openprom");
+    dev = qdev_create(NULL, "openprom", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
 
@@ -750,7 +750,7 @@  static void ram_init(target_phys_addr_t addr, ram_addr_t RAM_size,
                 (unsigned int)(max_mem / (1024 * 1024)));
         exit(1);
     }
-    dev = qdev_create(NULL, "memory");
+    dev = qdev_create(NULL, "memory", NULL);
     s = sysbus_from_qdev(dev);
 
     d = FROM_SYSBUS(RamDevice, s);
@@ -1470,7 +1470,7 @@  static DeviceState *sbi_init(target_phys_addr_t addr, qemu_irq **parent_irq)
     SysBusDevice *s;
     unsigned int i;
 
-    dev = qdev_create(NULL, "sbi");
+    dev = qdev_create(NULL, "sbi", NULL);
     qdev_init_nofail(dev);
 
     s = sysbus_from_qdev(dev);
@@ -1665,7 +1665,7 @@  static DeviceState *sun4c_intctl_init(target_phys_addr_t addr,
     SysBusDevice *s;
     unsigned int i;
 
-    dev = qdev_create(NULL, "sun4c_intctl");
+    dev = qdev_create(NULL, "sun4c_intctl", NULL);
     qdev_init_nofail(dev);
 
     s = sysbus_from_qdev(dev);
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 32e6ab9..ab6020f 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -595,7 +595,7 @@  static void prom_init(target_phys_addr_t addr, const char *bios_name)
     char *filename;
     int ret;
 
-    dev = qdev_create(NULL, "openprom");
+    dev = qdev_create(NULL, "openprom", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
 
@@ -674,7 +674,7 @@  static void ram_init(target_phys_addr_t addr, ram_addr_t RAM_size)
     RamDevice *d;
 
     /* allocate RAM */
-    dev = qdev_create(NULL, "memory");
+    dev = qdev_create(NULL, "memory", NULL);
     s = sysbus_from_qdev(dev);
 
     d = FROM_SYSBUS(RamDevice, s);
diff --git a/hw/syborg.c b/hw/syborg.c
index bc200e4..5725f8a 100644
--- a/hw/syborg.c
+++ b/hw/syborg.c
@@ -62,7 +62,7 @@  static void syborg_init(ram_addr_t ram_size,
 
     sysbus_create_simple("syborg,rtc", 0xC0001000, NULL);
 
-    dev = qdev_create(NULL, "syborg,timer");
+    dev = qdev_create(NULL, "syborg,timer", NULL);
     qdev_prop_set_uint32(dev, "frequency", 1000000);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0xC0002000);
@@ -81,7 +81,7 @@  static void syborg_init(ram_addr_t ram_size,
         SysBusDevice *s;
 
         qemu_check_nic_model(&nd_table[0], "virtio");
-        dev = qdev_create(NULL, "syborg,virtio-net");
+        dev = qdev_create(NULL, "syborg,virtio-net", NULL);
         qdev_set_nic_properties(dev, &nd_table[0]);
         qdev_init_nofail(dev);
         s = sysbus_from_qdev(dev);
diff --git a/hw/sysbus.c b/hw/sysbus.c
index 4fab5a4..7809aa1 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -182,7 +182,7 @@  DeviceState *sysbus_create_varargs(const char *name,
     qemu_irq irq;
     int n;
 
-    dev = qdev_create(NULL, name);
+    dev = qdev_create(NULL, name, NULL);
     s = sysbus_from_qdev(dev);
     qdev_init_nofail(dev);
     if (addr != (target_phys_addr_t)-1) {
@@ -210,7 +210,7 @@  DeviceState *sysbus_try_create_varargs(const char *name,
     qemu_irq irq;
     int n;
 
-    dev = qdev_try_create(NULL, name);
+    dev = qdev_try_create(NULL, name, NULL);
     if (!dev) {
         return NULL;
     }
diff --git a/hw/unin_pci.c b/hw/unin_pci.c
index 600cd1e..8fa346f 100644
--- a/hw/unin_pci.c
+++ b/hw/unin_pci.c
@@ -211,7 +211,7 @@  PCIBus *pci_pmac_init(qemu_irq *pic,
 
     /* Use values found on a real PowerMac */
     /* Uninorth main bus */
-    dev = qdev_create(NULL, "uni-north");
+    dev = qdev_create(NULL, "uni-north", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     d = FROM_SYSBUS(UNINState, s);
@@ -237,7 +237,7 @@  PCIBus *pci_pmac_init(qemu_irq *pic,
 
     /* Uninorth AGP bus */
     pci_create_simple(d->host_state.bus, PCI_DEVFN(11, 0), "uni-north-agp");
-    dev = qdev_create(NULL, "uni-north-agp");
+    dev = qdev_create(NULL, "uni-north-agp", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     sysbus_mmio_map(s, 0, 0xf0800000);
@@ -247,7 +247,7 @@  PCIBus *pci_pmac_init(qemu_irq *pic,
 #if 0
     /* XXX: not needed for now */
     pci_create_simple(d->host_state.bus, PCI_DEVFN(14, 0), "uni-north-pci");
-    dev = qdev_create(NULL, "uni-north-pci");
+    dev = qdev_create(NULL, "uni-north-pci", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     sysbus_mmio_map(s, 0, 0xf4800000);
@@ -267,7 +267,7 @@  PCIBus *pci_pmac_u3_init(qemu_irq *pic,
 
     /* Uninorth AGP bus */
 
-    dev = qdev_create(NULL, "u3-agp");
+    dev = qdev_create(NULL, "u3-agp", NULL);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
     d = FROM_SYSBUS(UNINState, s);
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 93f640d..4c3682e 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -132,7 +132,7 @@  USBDevice *usb_create(USBBus *bus, const char *name)
     }
 #endif
 
-    dev = qdev_create(&bus->qbus, name);
+    dev = qdev_create(&bus->qbus, name, NULL);
     return DO_UPCAST(USBDevice, qdev, dev);
 }
 
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 49f8f5f..b713aac 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -198,7 +198,7 @@  static void versatile_init(ram_addr_t ram_size,
     /* SDRAM at address zero.  */
     cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
 
-    sysctl = qdev_create(NULL, "realview_sysctl");
+    sysctl = qdev_create(NULL, "realview_sysctl", NULL);
     qdev_prop_set_uint32(sysctl, "sys_id", 0x41007004);
     qdev_init_nofail(sysctl);
     qdev_prop_set_uint32(sysctl, "proc_id", 0x02000000);
diff --git a/hw/vexpress.c b/hw/vexpress.c
index c9766dd..191a5a2 100644
--- a/hw/vexpress.c
+++ b/hw/vexpress.c
@@ -85,7 +85,7 @@  static void vexpress_a9_init(ram_addr_t ram_size,
                                  ram_offset | IO_MEM_RAM);
 
     /* 0x1e000000 A9MPCore (SCU) private memory region */
-    dev = qdev_create(NULL, "a9mpcore_priv");
+    dev = qdev_create(NULL, "a9mpcore_priv", NULL);
     qdev_prop_set_uint32(dev, "num-cpu", smp_cpus);
     qdev_init_nofail(dev);
     busdev = sysbus_from_qdev(dev);
@@ -109,7 +109,7 @@  static void vexpress_a9_init(ram_addr_t ram_size,
     proc_id = 0x0c000191;
 
     /* 0x10000000 System registers */
-    sysctl = qdev_create(NULL, "realview_sysctl");
+    sysctl = qdev_create(NULL, "realview_sysctl", NULL);
     qdev_prop_set_uint32(sysctl, "sys_id", sys_id);
     qdev_init_nofail(sysctl);
     qdev_prop_set_uint32(sysctl, "proc_id", proc_id);
diff --git a/hw/xilinx.h b/hw/xilinx.h
index 35f35bd..6eb0d35 100644
--- a/hw/xilinx.h
+++ b/hw/xilinx.h
@@ -6,7 +6,7 @@  xilinx_intc_create(target_phys_addr_t base, qemu_irq irq, int kind_of_intr)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "xilinx,intc");
+    dev = qdev_create(NULL, "xilinx,intc", NULL);
     qdev_prop_set_uint32(dev, "kind-of-intr", kind_of_intr);
     qdev_init_nofail(dev);
     sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
@@ -20,7 +20,7 @@  xilinx_timer_create(target_phys_addr_t base, qemu_irq irq, int nr, int freq)
 {
     DeviceState *dev;
 
-    dev = qdev_create(NULL, "xilinx,timer");
+    dev = qdev_create(NULL, "xilinx,timer", NULL);
     qdev_prop_set_uint32(dev, "nr-timers", nr);
     qdev_prop_set_uint32(dev, "frequency", freq);
     qdev_init_nofail(dev);
@@ -38,7 +38,7 @@  xilinx_ethlite_create(NICInfo *nd, target_phys_addr_t base, qemu_irq irq,
 
     qemu_check_nic_model(nd, "xilinx-ethlite");
 
-    dev = qdev_create(NULL, "xilinx,ethlite");
+    dev = qdev_create(NULL, "xilinx,ethlite", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "txpingpong", txpingpong);
     qdev_prop_set_uint32(dev, "rxpingpong", rxpingpong);
@@ -56,7 +56,7 @@  xilinx_axiethernet_create(void *dmach,
     DeviceState *dev;
     qemu_check_nic_model(nd, "xilinx-axienet");
 
-    dev = qdev_create(NULL, "xilinx,axienet");
+    dev = qdev_create(NULL, "xilinx,axienet", NULL);
     qdev_set_nic_properties(dev, nd);
     qdev_prop_set_uint32(dev, "c_rxmem", rxmem);
     qdev_prop_set_uint32(dev, "c_txmem", txmem);
@@ -75,7 +75,7 @@  xilinx_axiethernetdma_create(void *dmach,
 {
     DeviceState *dev = NULL;
 
-    dev = qdev_create(NULL, "xilinx,axidma");
+    dev = qdev_create(NULL, "xilinx,axidma", NULL);
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
     qdev_prop_set_ptr(dev, "dmach", dmach);
     qdev_init_nofail(dev);