SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)

{

    const char *driver;

    DeviceState *dev;



    driver = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk";

    dev = qdev_create(&bus->qbus, driver);

    qdev_prop_set_uint32(dev, "scsi-id", unit);

    qdev_prop_set_drive(dev, "drive", dinfo);

    qdev_init(dev);

    return DO_UPCAST(SCSIDevice, qdev, dev);

}

SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)

{

    const char *driver;

    DeviceState *dev;



    driver = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk";

    dev = qdev_create(&bus->qbus, driver);

    qdev_prop_set_uint32(dev, "scsi-id", unit);

    qdev_prop_set_drive(dev, "drive", dinfo);

    qdev_init(dev);

    return DO_UPCAST(SCSIDevice, qdev, dev);

}

    qdev_init(dev);
SCSIDevice *FUNC_0(SCSIBus *bus, DriveInfo *dinfo, int unit)

{

    const char *VAR_0;

    DeviceState *dev;



    VAR_0 = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk";

    dev = qdev_create(&bus->qbus, VAR_0);

    qdev_prop_set_uint32(dev, "scsi-id", unit);

    qdev_prop_set_drive(dev, "drive", dinfo);

    qdev_init(dev);

    return DO_UPCAST(SCSIDevice, qdev, dev);

}

SCSIDevice *FUNC_0(SCSIBus *bus, DriveInfo *dinfo, int unit)
{ const char *VAR_0; DeviceState *dev; VAR_0 = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk"; dev = qdev_create(&bus->qbus, VAR_0); qdev_prop_set_uint32(dev, "scsi-id", unit); qdev_prop_set_drive(dev, "drive", dinfo); qdev_init(dev); return DO_UPCAST(SCSIDevice, qdev, dev); }