mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Check return value of qdev_init()
But do so only where it may actually fail. Leave the rest for the next commit. Patchworks-ID: 35167 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
18cfeb52d1
commit
33e66b86d8
5 changed files with 12 additions and 6 deletions
|
@ -82,6 +82,7 @@ void scsi_qdev_register(SCSIDeviceInfo *info)
|
|||
}
|
||||
|
||||
/* handle legacy '-drive if=scsi,...' cmd line args */
|
||||
/* FIXME callers should check for failure, but don't */
|
||||
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)
|
||||
{
|
||||
const char *driver;
|
||||
|
@ -91,7 +92,8 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)
|
|||
dev = qdev_create(&bus->qbus, driver);
|
||||
qdev_prop_set_uint32(dev, "scsi-id", unit);
|
||||
qdev_prop_set_drive(dev, "drive", dinfo);
|
||||
qdev_init(dev);
|
||||
if (qdev_init(dev) < 0)
|
||||
return NULL;
|
||||
return DO_UPCAST(SCSIDevice, qdev, dev);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue