diff options
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/qdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 06b11583f5..caa88526f5 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -127,11 +127,11 @@ 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_new(drive->media_cd ? "ide-cd" : "ide-hd"); qdev_prop_set_uint32(dev, "unit", unit); qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(drive), &error_fatal); - qdev_init_nofail(dev); + qdev_realize_and_unref(dev, &bus->qbus, &error_fatal); return DO_UPCAST(IDEDevice, qdev, dev); } |