scsi: make reqops const
Also delete a stale occurrence of SCSIReqOps inside SCSIDeviceInfo. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7877903aa0
commit
adcf2754b9
@ -160,7 +160,7 @@ static int32_t scsi_invalid_command(SCSIRequest *req, uint8_t *buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct SCSIReqOps reqops_invalid_opcode = {
|
||||
static const struct SCSIReqOps reqops_invalid_opcode = {
|
||||
.size = sizeof(SCSIRequest),
|
||||
.send_command = scsi_invalid_command
|
||||
};
|
||||
@ -178,7 +178,7 @@ static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct SCSIReqOps reqops_unit_attention = {
|
||||
static const struct SCSIReqOps reqops_unit_attention = {
|
||||
.size = sizeof(SCSIRequest),
|
||||
.send_command = scsi_unit_attention
|
||||
};
|
||||
@ -386,7 +386,7 @@ static uint8_t *scsi_target_get_buf(SCSIRequest *req)
|
||||
return r->buf;
|
||||
}
|
||||
|
||||
struct SCSIReqOps reqops_target_command = {
|
||||
static const struct SCSIReqOps reqops_target_command = {
|
||||
.size = sizeof(SCSITargetReq),
|
||||
.send_command = scsi_target_send_command,
|
||||
.read_data = scsi_target_read_data,
|
||||
@ -394,8 +394,8 @@ struct SCSIReqOps reqops_target_command = {
|
||||
};
|
||||
|
||||
|
||||
SCSIRequest *scsi_req_alloc(SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag,
|
||||
uint32_t lun, void *hba_private)
|
||||
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
|
||||
uint32_t tag, uint32_t lun, void *hba_private)
|
||||
{
|
||||
SCSIRequest *req;
|
||||
|
||||
|
@ -1588,7 +1588,7 @@ static int scsi_disk_initfn(SCSIDevice *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static SCSIReqOps scsi_disk_reqops = {
|
||||
static const SCSIReqOps scsi_disk_reqops = {
|
||||
.size = sizeof(SCSIDiskReq),
|
||||
.free_req = scsi_free_request,
|
||||
.send_command = scsi_send_command,
|
||||
|
@ -420,7 +420,7 @@ static int scsi_generic_initfn(SCSIDevice *s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SCSIReqOps scsi_generic_req_ops = {
|
||||
static const SCSIReqOps scsi_generic_req_ops = {
|
||||
.size = sizeof(SCSIGenericReq),
|
||||
.free_req = scsi_free_request,
|
||||
.send_command = scsi_send_command,
|
||||
|
@ -41,7 +41,7 @@ struct SCSICommand {
|
||||
struct SCSIRequest {
|
||||
SCSIBus *bus;
|
||||
SCSIDevice *dev;
|
||||
SCSIReqOps *ops;
|
||||
const SCSIReqOps *ops;
|
||||
uint32_t refcount;
|
||||
uint32_t tag;
|
||||
uint32_t lun;
|
||||
@ -96,7 +96,6 @@ struct SCSIDeviceInfo {
|
||||
SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
|
||||
void *hba_private);
|
||||
void (*unit_attention_reported)(SCSIDevice *s);
|
||||
SCSIReqOps reqops;
|
||||
};
|
||||
|
||||
struct SCSIBusInfo {
|
||||
@ -176,8 +175,8 @@ extern const struct SCSISense sense_code_DEVICE_INTERNAL_RESET;
|
||||
|
||||
int scsi_sense_valid(SCSISense sense);
|
||||
|
||||
SCSIRequest *scsi_req_alloc(SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag,
|
||||
uint32_t lun, void *hba_private);
|
||||
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
|
||||
uint32_t tag, uint32_t lun, void *hba_private);
|
||||
SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
||||
uint8_t *buf, void *hba_private);
|
||||
int32_t scsi_req_enqueue(SCSIRequest *req);
|
||||
|
Loading…
Reference in New Issue
Block a user