Revision 74382217 hw/scsi-disk.c

b/hw/scsi-disk.c
340 340
    return (uint8_t *)r->iov.iov_base;
341 341
}
342 342

  
343
/* Copy sense information into the provided buffer */
344
static int scsi_get_sense(SCSIRequest *req, uint8_t *outbuf, int len)
345
{
346
    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
347

  
348
    return scsi_build_sense(s->sense, outbuf, len, len > 14);
349
}
350

  
343 351
static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
344 352
{
345 353
    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
......
1257 1265
        .write_data   = scsi_write_data,
1258 1266
        .cancel_io    = scsi_cancel_io,
1259 1267
        .get_buf      = scsi_get_buf,
1268
        .get_sense    = scsi_get_sense,
1260 1269
        .qdev.props   = (Property[]) {
1261 1270
            DEFINE_SCSI_DISK_PROPERTIES(),
1262 1271
            DEFINE_PROP_BIT("removable", SCSIDiskState, removable, 0, false),
......
1277 1286
        .write_data   = scsi_write_data,
1278 1287
        .cancel_io    = scsi_cancel_io,
1279 1288
        .get_buf      = scsi_get_buf,
1289
        .get_sense    = scsi_get_sense,
1280 1290
        .qdev.props   = (Property[]) {
1281 1291
            DEFINE_SCSI_DISK_PROPERTIES(),
1282 1292
            DEFINE_PROP_END_OF_LIST(),
......
1296 1306
        .write_data   = scsi_write_data,
1297 1307
        .cancel_io    = scsi_cancel_io,
1298 1308
        .get_buf      = scsi_get_buf,
1309
        .get_sense    = scsi_get_sense,
1299 1310
        .qdev.props   = (Property[]) {
1300 1311
            DEFINE_SCSI_DISK_PROPERTIES(),
1301 1312
            DEFINE_PROP_BIT("removable", SCSIDiskState, removable, 0, false),

Also available in: Unified diff