2009-11-26 15:33:47 +01:00
|
|
|
#ifndef QEMU_HW_SCSI_H
|
|
|
|
#define QEMU_HW_SCSI_H
|
2009-10-30 09:54:00 +01:00
|
|
|
|
2013-02-04 15:40:22 +01:00
|
|
|
#include "hw/qdev.h"
|
2014-10-07 13:59:18 +02:00
|
|
|
#include "qemu/typedefs.h"
|
2013-02-05 17:06:20 +01:00
|
|
|
#include "hw/block/block.h"
|
2012-12-17 18:20:04 +01:00
|
|
|
#include "sysemu/sysemu.h"
|
2014-09-28 03:48:00 +02:00
|
|
|
#include "qemu/notify.h"
|
2009-10-30 09:54:00 +01:00
|
|
|
|
2011-01-28 11:21:40 +01:00
|
|
|
#define MAX_SCSI_DEVS 255
|
|
|
|
|
2009-11-26 15:33:51 +01:00
|
|
|
#define SCSI_CMD_BUF_SIZE 16
|
2013-10-09 09:41:03 +02:00
|
|
|
#define SCSI_SENSE_LEN 18
|
|
|
|
#define SCSI_INQUIRY_LEN 36
|
2009-11-26 15:33:51 +01:00
|
|
|
|
2009-10-30 09:54:00 +01:00
|
|
|
typedef struct SCSIBus SCSIBus;
|
2011-08-13 15:44:45 +02:00
|
|
|
typedef struct SCSIBusInfo SCSIBusInfo;
|
2011-08-03 10:49:11 +02:00
|
|
|
typedef struct SCSICommand SCSICommand;
|
2009-10-30 09:54:00 +01:00
|
|
|
typedef struct SCSIDevice SCSIDevice;
|
2011-04-18 12:35:39 +02:00
|
|
|
typedef struct SCSIRequest SCSIRequest;
|
2011-08-03 10:49:08 +02:00
|
|
|
typedef struct SCSIReqOps SCSIReqOps;
|
2009-10-30 09:54:00 +01:00
|
|
|
|
2009-11-26 15:33:57 +01:00
|
|
|
enum SCSIXferMode {
|
|
|
|
SCSI_XFER_NONE, /* TEST_UNIT_READY, ... */
|
|
|
|
SCSI_XFER_FROM_DEV, /* READ, INQUIRY, MODE_SENSE, ... */
|
|
|
|
SCSI_XFER_TO_DEV, /* WRITE, MODE_SELECT, ... */
|
|
|
|
};
|
|
|
|
|
2011-04-18 12:53:14 +02:00
|
|
|
typedef struct SCSISense {
|
|
|
|
uint8_t key;
|
|
|
|
uint8_t asc;
|
|
|
|
uint8_t ascq;
|
|
|
|
} SCSISense;
|
|
|
|
|
2014-03-06 09:26:02 +01:00
|
|
|
#define SCSI_SENSE_BUF_SIZE_OLD 96
|
scsi: Change scsi sense buf size to 252
Current buffer size fails the assersion check in like
hw/scsi/scsi-bus.c:1655: assert(req->sense_len <= sizeof(req->sense));
when backend (block/iscsi.c) returns more data then 96.
Exercise the core dump path by booting an Gentoo ISO with scsi-generic
device backed with iscsi (built with libiscsi 1.7.0):
x86_64-softmmu/qemu-system-x86_64 \
-drive file=iscsi://localhost:3260/iqn.foobar/0,if=none,id=drive-disk \
-device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x6 \
-device scsi-generic,drive=drive-disk,bus=scsi1.0,id=iscsi-disk \
-boot d \
-cdrom gentoo.iso
qemu-system-x86_64: hw/scsi/scsi-bus.c:1655: scsi_req_complete:
Assertion `req->sense_len <= sizeof(req->sense)' failed.
According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So
increase the value to fix it.
Also remove duplicated define for the macro.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-01-24 08:02:24 +01:00
|
|
|
#define SCSI_SENSE_BUF_SIZE 252
|
2011-08-03 10:49:07 +02:00
|
|
|
|
2011-08-03 10:49:11 +02:00
|
|
|
struct SCSICommand {
|
|
|
|
uint8_t buf[SCSI_CMD_BUF_SIZE];
|
|
|
|
int len;
|
|
|
|
size_t xfer;
|
|
|
|
uint64_t lba;
|
|
|
|
enum SCSIXferMode mode;
|
|
|
|
};
|
|
|
|
|
2011-04-18 12:35:39 +02:00
|
|
|
struct SCSIRequest {
|
2009-11-26 15:33:48 +01:00
|
|
|
SCSIBus *bus;
|
|
|
|
SCSIDevice *dev;
|
2011-10-12 12:57:59 +02:00
|
|
|
const SCSIReqOps *ops;
|
2011-04-18 16:01:56 +02:00
|
|
|
uint32_t refcount;
|
2009-11-26 15:33:48 +01:00
|
|
|
uint32_t tag;
|
2009-11-26 15:33:50 +01:00
|
|
|
uint32_t lun;
|
2009-11-26 15:34:00 +01:00
|
|
|
uint32_t status;
|
2014-09-16 09:20:17 +02:00
|
|
|
void *hba_private;
|
2011-07-06 11:55:37 +02:00
|
|
|
size_t resid;
|
2011-08-03 10:49:11 +02:00
|
|
|
SCSICommand cmd;
|
2014-09-28 03:48:00 +02:00
|
|
|
NotifierList cancel_notifiers;
|
2014-09-16 09:20:17 +02:00
|
|
|
|
|
|
|
/* Note:
|
|
|
|
* - fields before sense are initialized by scsi_req_alloc;
|
|
|
|
* - sense[] is uninitialized;
|
|
|
|
* - fields after sense are memset to 0 by scsi_req_alloc.
|
|
|
|
* */
|
|
|
|
|
|
|
|
uint8_t sense[SCSI_SENSE_BUF_SIZE];
|
|
|
|
uint32_t sense_len;
|
|
|
|
bool enqueued;
|
|
|
|
bool io_canceled;
|
|
|
|
bool retry;
|
|
|
|
bool dma_started;
|
2014-10-07 13:59:14 +02:00
|
|
|
BlockAIOCB *aiocb;
|
2011-07-06 11:26:47 +02:00
|
|
|
QEMUSGList *sg;
|
2009-11-26 15:33:49 +01:00
|
|
|
QTAILQ_ENTRY(SCSIRequest) next;
|
2011-04-18 12:35:39 +02:00
|
|
|
};
|
2009-11-26 15:33:48 +01:00
|
|
|
|
2011-12-15 21:50:08 +01:00
|
|
|
#define TYPE_SCSI_DEVICE "scsi-device"
|
|
|
|
#define SCSI_DEVICE(obj) \
|
|
|
|
OBJECT_CHECK(SCSIDevice, (obj), TYPE_SCSI_DEVICE)
|
|
|
|
#define SCSI_DEVICE_CLASS(klass) \
|
|
|
|
OBJECT_CLASS_CHECK(SCSIDeviceClass, (klass), TYPE_SCSI_DEVICE)
|
|
|
|
#define SCSI_DEVICE_GET_CLASS(obj) \
|
|
|
|
OBJECT_GET_CLASS(SCSIDeviceClass, (obj), TYPE_SCSI_DEVICE)
|
|
|
|
|
|
|
|
typedef struct SCSIDeviceClass {
|
|
|
|
DeviceClass parent_class;
|
2014-08-12 04:12:55 +02:00
|
|
|
void (*realize)(SCSIDevice *dev, Error **errp);
|
2014-07-16 10:39:05 +02:00
|
|
|
int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf,
|
|
|
|
void *hba_private);
|
2011-12-15 21:50:08 +01:00
|
|
|
SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
|
|
|
|
uint8_t *buf, void *hba_private);
|
|
|
|
void (*unit_attention_reported)(SCSIDevice *s);
|
|
|
|
} SCSIDeviceClass;
|
|
|
|
|
2009-10-30 09:54:00 +01:00
|
|
|
struct SCSIDevice
|
|
|
|
{
|
|
|
|
DeviceState qdev;
|
2011-10-25 12:53:36 +02:00
|
|
|
VMChangeStateEntry *vmsentry;
|
|
|
|
QEMUBH *bh;
|
2009-10-30 09:54:00 +01:00
|
|
|
uint32_t id;
|
block: add topology qdev properties
Add three new qdev properties to export block topology information to
the guest. This is needed to get optimal I/O alignment for RAID arrays
or SSDs.
The options are:
- physical_block_size to specify the physical block size of the device,
this is going to increase from 512 bytes to 4096 kilobytes for many
modern storage devices
- min_io_size to specify the minimal I/O size without performance impact,
this is typically set to the RAID chunk size for arrays.
- opt_io_size to specify the optimal sustained I/O size, this is
typically the RAID stripe width for arrays.
I decided to not auto-probe these values from blkid which might easily
be possible as I don't know how to deal with these issues on migration.
Note that we specificly only set the physical_block_size, and not the
logial one which is the unit all I/O is described in. The reason for
that is that IDE does not support increasing the logical block size and
at last for now I want to stick to one meachnisms in queue and allow
for easy switching of transports for a given backing image which would
not be possible if scsi and virtio use real 4k sectors, while ide only
uses the physical block exponent.
To make this more common for the different block drivers introduce a
new BlockConf structure holding all common block properties and a
DEFINE_BLOCK_PROPERTIES macro to add them all together, mirroring
what is done for network drivers. Also switch over all block drivers
to use it, except for the floppy driver which has weird driveA/driveB
properties and probably won't require any advanced block options ever.
Example usage for a virtio device with 4k physical block size and
8k optimal I/O size:
-drive file=scratch.img,media=disk,cache=none,id=scratch \
-device virtio-blk-pci,drive=scratch,physical_block_size=4096,opt_io_size=8192
aliguori: updated patch to take into account BLOCK events
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-10 23:37:09 +01:00
|
|
|
BlockConf conf;
|
2011-08-03 10:49:17 +02:00
|
|
|
SCSISense unit_attention;
|
2011-09-13 16:19:53 +02:00
|
|
|
bool sense_is_ua;
|
2011-08-03 10:49:07 +02:00
|
|
|
uint8_t sense[SCSI_SENSE_BUF_SIZE];
|
|
|
|
uint32_t sense_len;
|
2009-11-26 15:33:49 +01:00
|
|
|
QTAILQ_HEAD(, SCSIRequest) requests;
|
2011-07-27 23:24:50 +02:00
|
|
|
uint32_t channel;
|
2011-08-03 10:49:12 +02:00
|
|
|
uint32_t lun;
|
2009-11-26 15:33:52 +01:00
|
|
|
int blocksize;
|
2009-11-26 15:33:54 +01:00
|
|
|
int type;
|
2011-10-13 10:39:50 +02:00
|
|
|
uint64_t max_lba;
|
2009-10-30 09:54:00 +01:00
|
|
|
};
|
|
|
|
|
2011-12-02 16:27:02 +01:00
|
|
|
extern const VMStateDescription vmstate_scsi_device;
|
|
|
|
|
|
|
|
#define VMSTATE_SCSI_DEVICE(_field, _state) { \
|
|
|
|
.name = (stringify(_field)), \
|
|
|
|
.size = sizeof(SCSIDevice), \
|
|
|
|
.vmsd = &vmstate_scsi_device, \
|
|
|
|
.flags = VMS_STRUCT, \
|
|
|
|
.offset = vmstate_offset_value(_state, _field, SCSIDevice), \
|
|
|
|
}
|
|
|
|
|
2009-10-30 09:54:00 +01:00
|
|
|
/* cdrom.c */
|
|
|
|
int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
|
|
|
|
int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
|
|
|
|
|
|
|
|
/* scsi-bus.c */
|
2011-08-03 10:49:08 +02:00
|
|
|
struct SCSIReqOps {
|
|
|
|
size_t size;
|
2011-08-03 10:49:09 +02:00
|
|
|
void (*free_req)(SCSIRequest *req);
|
|
|
|
int32_t (*send_command)(SCSIRequest *req, uint8_t *buf);
|
|
|
|
void (*read_data)(SCSIRequest *req);
|
|
|
|
void (*write_data)(SCSIRequest *req);
|
|
|
|
uint8_t *(*get_buf)(SCSIRequest *req);
|
2011-12-02 16:27:02 +01:00
|
|
|
|
|
|
|
void (*save_request)(QEMUFile *f, SCSIRequest *req);
|
|
|
|
void (*load_request)(QEMUFile *f, SCSIRequest *req);
|
2011-08-03 10:49:08 +02:00
|
|
|
};
|
|
|
|
|
2011-08-13 15:44:45 +02:00
|
|
|
struct SCSIBusInfo {
|
2011-08-13 18:55:17 +02:00
|
|
|
int tcq;
|
2011-07-27 23:24:50 +02:00
|
|
|
int max_channel, max_target, max_lun;
|
2014-07-16 10:39:05 +02:00
|
|
|
int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf,
|
|
|
|
void *hba_private);
|
2011-04-22 12:27:30 +02:00
|
|
|
void (*transfer_data)(SCSIRequest *req, uint32_t arg);
|
2011-07-06 11:55:37 +02:00
|
|
|
void (*complete)(SCSIRequest *req, uint32_t arg, size_t resid);
|
2011-04-18 22:53:08 +02:00
|
|
|
void (*cancel)(SCSIRequest *req);
|
2012-07-16 14:22:36 +02:00
|
|
|
void (*change)(SCSIBus *bus, SCSIDevice *dev, SCSISense sense);
|
2011-07-06 11:26:47 +02:00
|
|
|
QEMUSGList *(*get_sg_list)(SCSIRequest *req);
|
2011-12-02 16:27:02 +01:00
|
|
|
|
|
|
|
void (*save_request)(QEMUFile *f, SCSIRequest *req);
|
|
|
|
void *(*load_request)(QEMUFile *f, SCSIRequest *req);
|
2012-07-09 12:06:28 +02:00
|
|
|
void (*free_request)(SCSIBus *bus, void *priv);
|
2011-04-18 17:11:14 +02:00
|
|
|
};
|
|
|
|
|
2012-05-02 09:00:20 +02:00
|
|
|
#define TYPE_SCSI_BUS "SCSI"
|
|
|
|
#define SCSI_BUS(obj) OBJECT_CHECK(SCSIBus, (obj), TYPE_SCSI_BUS)
|
|
|
|
|
2009-10-30 09:54:00 +01:00
|
|
|
struct SCSIBus {
|
|
|
|
BusState qbus;
|
|
|
|
int busnr;
|
|
|
|
|
2011-08-03 10:49:17 +02:00
|
|
|
SCSISense unit_attention;
|
2011-08-13 15:44:45 +02:00
|
|
|
const SCSIBusInfo *info;
|
2009-10-30 09:54:00 +01:00
|
|
|
};
|
|
|
|
|
2013-08-23 20:30:03 +02:00
|
|
|
void scsi_bus_new(SCSIBus *bus, size_t bus_size, DeviceState *host,
|
|
|
|
const SCSIBusInfo *info, const char *bus_name);
|
2009-10-30 09:54:00 +01:00
|
|
|
|
|
|
|
static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)
|
|
|
|
{
|
|
|
|
return DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus);
|
|
|
|
}
|
|
|
|
|
2014-10-07 13:59:18 +02:00
|
|
|
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
|
2013-04-03 12:41:46 +02:00
|
|
|
int unit, bool removable, int bootindex,
|
2013-07-21 12:16:34 +02:00
|
|
|
const char *serial, Error **errp);
|
|
|
|
void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Error **errp);
|
2009-10-30 09:54:00 +01:00
|
|
|
|
2011-04-18 12:53:14 +02:00
|
|
|
/*
|
|
|
|
* Predefined sense codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* No sense data available */
|
|
|
|
extern const struct SCSISense sense_code_NO_SENSE;
|
|
|
|
/* LUN not ready, Manual intervention required */
|
|
|
|
extern const struct SCSISense sense_code_LUN_NOT_READY;
|
|
|
|
/* LUN not ready, Medium not present */
|
|
|
|
extern const struct SCSISense sense_code_NO_MEDIUM;
|
2011-09-06 18:58:49 +02:00
|
|
|
/* LUN not ready, medium removal prevented */
|
|
|
|
extern const struct SCSISense sense_code_NOT_READY_REMOVAL_PREVENTED;
|
2011-04-18 12:53:14 +02:00
|
|
|
/* Hardware error, internal target failure */
|
|
|
|
extern const struct SCSISense sense_code_TARGET_FAILURE;
|
|
|
|
/* Illegal request, invalid command operation code */
|
|
|
|
extern const struct SCSISense sense_code_INVALID_OPCODE;
|
|
|
|
/* Illegal request, LBA out of range */
|
|
|
|
extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE;
|
|
|
|
/* Illegal request, Invalid field in CDB */
|
|
|
|
extern const struct SCSISense sense_code_INVALID_FIELD;
|
2012-07-10 15:02:55 +02:00
|
|
|
/* Illegal request, Invalid field in parameter list */
|
|
|
|
extern const struct SCSISense sense_code_INVALID_PARAM;
|
|
|
|
/* Illegal request, Parameter list length error */
|
|
|
|
extern const struct SCSISense sense_code_INVALID_PARAM_LEN;
|
2011-04-18 12:53:14 +02:00
|
|
|
/* Illegal request, LUN not supported */
|
|
|
|
extern const struct SCSISense sense_code_LUN_NOT_SUPPORTED;
|
2011-08-03 10:49:16 +02:00
|
|
|
/* Illegal request, Saving parameters not supported */
|
|
|
|
extern const struct SCSISense sense_code_SAVING_PARAMS_NOT_SUPPORTED;
|
|
|
|
/* Illegal request, Incompatible format */
|
|
|
|
extern const struct SCSISense sense_code_INCOMPATIBLE_FORMAT;
|
2011-09-06 18:58:49 +02:00
|
|
|
/* Illegal request, medium removal prevented */
|
|
|
|
extern const struct SCSISense sense_code_ILLEGAL_REQ_REMOVAL_PREVENTED;
|
2013-10-24 19:15:49 +02:00
|
|
|
/* Illegal request, Invalid Transfer Tag */
|
|
|
|
extern const struct SCSISense sense_code_INVALID_TAG;
|
2011-04-18 12:53:14 +02:00
|
|
|
/* Command aborted, I/O process terminated */
|
|
|
|
extern const struct SCSISense sense_code_IO_ERROR;
|
|
|
|
/* Command aborted, I_T Nexus loss occurred */
|
|
|
|
extern const struct SCSISense sense_code_I_T_NEXUS_LOSS;
|
|
|
|
/* Command aborted, Logical Unit failure */
|
|
|
|
extern const struct SCSISense sense_code_LUN_FAILURE;
|
2013-10-24 19:15:49 +02:00
|
|
|
/* Command aborted, Overlapped Commands Attempted */
|
|
|
|
extern const struct SCSISense sense_code_OVERLAPPED_COMMANDS;
|
2012-07-16 14:07:55 +02:00
|
|
|
/* LUN not ready, Capacity data has changed */
|
|
|
|
extern const struct SCSISense sense_code_CAPACITY_CHANGED;
|
2011-09-13 16:26:06 +02:00
|
|
|
/* LUN not ready, Medium not present */
|
|
|
|
extern const struct SCSISense sense_code_UNIT_ATTENTION_NO_MEDIUM;
|
2011-08-03 10:49:16 +02:00
|
|
|
/* Unit attention, Power on, reset or bus device reset occurred */
|
|
|
|
extern const struct SCSISense sense_code_RESET;
|
|
|
|
/* Unit attention, Medium may have changed*/
|
|
|
|
extern const struct SCSISense sense_code_MEDIUM_CHANGED;
|
|
|
|
/* Unit attention, Reported LUNs data has changed */
|
|
|
|
extern const struct SCSISense sense_code_REPORTED_LUNS_CHANGED;
|
|
|
|
/* Unit attention, Device internal reset */
|
|
|
|
extern const struct SCSISense sense_code_DEVICE_INTERNAL_RESET;
|
2012-07-16 08:53:28 +02:00
|
|
|
/* Data Protection, Write Protected */
|
|
|
|
extern const struct SCSISense sense_code_WRITE_PROTECTED;
|
2014-01-23 13:57:21 +01:00
|
|
|
/* Data Protection, Space Allocation Failed Write Protect */
|
|
|
|
extern const struct SCSISense sense_code_SPACE_ALLOC_FAILED;
|
2011-04-18 12:53:14 +02:00
|
|
|
|
|
|
|
#define SENSE_CODE(x) sense_code_ ## x
|
|
|
|
|
2014-10-29 13:00:04 +01:00
|
|
|
uint32_t scsi_data_cdb_xfer(uint8_t *buf);
|
|
|
|
uint32_t scsi_cdb_xfer(uint8_t *buf);
|
|
|
|
int scsi_cdb_length(uint8_t *buf);
|
2011-04-18 12:53:14 +02:00
|
|
|
int scsi_sense_valid(SCSISense sense);
|
2011-11-14 14:31:51 +01:00
|
|
|
int scsi_build_sense(uint8_t *in_buf, int in_len,
|
|
|
|
uint8_t *buf, int len, bool fixed);
|
2011-04-18 12:53:14 +02:00
|
|
|
|
2011-10-12 12:57:59 +02:00
|
|
|
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
|
|
|
|
uint32_t tag, uint32_t lun, void *hba_private);
|
2011-07-11 15:02:24 +02:00
|
|
|
SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
2011-08-03 10:49:10 +02:00
|
|
|
uint8_t *buf, void *hba_private);
|
|
|
|
int32_t scsi_req_enqueue(SCSIRequest *req);
|
2011-04-18 16:01:56 +02:00
|
|
|
SCSIRequest *scsi_req_ref(SCSIRequest *req);
|
|
|
|
void scsi_req_unref(SCSIRequest *req);
|
2009-11-26 15:33:58 +01:00
|
|
|
|
2014-07-16 10:39:05 +02:00
|
|
|
int scsi_bus_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf,
|
|
|
|
void *hba_private);
|
2014-07-16 12:22:26 +02:00
|
|
|
int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf);
|
2011-08-03 10:49:07 +02:00
|
|
|
void scsi_req_build_sense(SCSIRequest *req, SCSISense sense);
|
2009-11-26 15:34:01 +01:00
|
|
|
void scsi_req_print(SCSIRequest *req);
|
2011-04-18 15:28:11 +02:00
|
|
|
void scsi_req_continue(SCSIRequest *req);
|
2011-04-18 14:59:13 +02:00
|
|
|
void scsi_req_data(SCSIRequest *req, int len);
|
2011-08-03 10:49:06 +02:00
|
|
|
void scsi_req_complete(SCSIRequest *req, int status);
|
2011-04-21 13:21:02 +02:00
|
|
|
uint8_t *scsi_req_get_buf(SCSIRequest *req);
|
2011-04-18 13:36:02 +02:00
|
|
|
int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len);
|
2014-09-25 04:20:47 +02:00
|
|
|
void scsi_req_cancel_complete(SCSIRequest *req);
|
2011-04-18 22:53:08 +02:00
|
|
|
void scsi_req_cancel(SCSIRequest *req);
|
2014-09-28 03:48:00 +02:00
|
|
|
void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier);
|
2011-10-25 12:53:36 +02:00
|
|
|
void scsi_req_retry(SCSIRequest *req);
|
2011-08-03 10:49:18 +02:00
|
|
|
void scsi_device_purge_requests(SCSIDevice *sdev, SCSISense sense);
|
2012-07-16 14:18:58 +02:00
|
|
|
void scsi_device_set_ua(SCSIDevice *sdev, SCSISense sense);
|
2012-07-16 14:22:36 +02:00
|
|
|
void scsi_device_report_change(SCSIDevice *dev, SCSISense sense);
|
2014-10-29 13:00:11 +01:00
|
|
|
void scsi_device_unit_attention_reported(SCSIDevice *dev);
|
2011-08-03 10:49:07 +02:00
|
|
|
int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed);
|
2011-07-27 23:24:50 +02:00
|
|
|
SCSIDevice *scsi_device_find(SCSIBus *bus, int channel, int target, int lun);
|
2009-11-26 15:33:50 +01:00
|
|
|
|
2011-10-12 12:54:31 +02:00
|
|
|
/* scsi-generic.c. */
|
|
|
|
extern const SCSIReqOps scsi_generic_req_ops;
|
|
|
|
|
2009-10-30 09:54:00 +01:00
|
|
|
#endif
|