mirror of https://github.com/xqemu/xqemu.git
scsi: pass cdb to alloc_req
This will let scsi-block choose between passthrough and emulation. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
765d1525a6
commit
63db0f0eee
|
@ -451,7 +451,7 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
||||||
req = scsi_req_alloc(&reqops_target_command, d, tag, lun,
|
req = scsi_req_alloc(&reqops_target_command, d, tag, lun,
|
||||||
hba_private);
|
hba_private);
|
||||||
} else {
|
} else {
|
||||||
req = d->info->alloc_req(d, tag, lun, hba_private);
|
req = d->info->alloc_req(d, tag, lun, buf, hba_private);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1598,8 +1598,8 @@ static const SCSIReqOps scsi_disk_reqops = {
|
||||||
.get_buf = scsi_get_buf,
|
.get_buf = scsi_get_buf,
|
||||||
};
|
};
|
||||||
|
|
||||||
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag,
|
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
||||||
uint32_t lun, void *hba_private)
|
uint8_t *buf, void *hba_private)
|
||||||
{
|
{
|
||||||
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);
|
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);
|
||||||
SCSIRequest *req;
|
SCSIRequest *req;
|
||||||
|
|
|
@ -431,7 +431,7 @@ const SCSIReqOps scsi_generic_req_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
||||||
void *hba_private)
|
uint8_t *buf, void *hba_private)
|
||||||
{
|
{
|
||||||
SCSIRequest *req;
|
SCSIRequest *req;
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct SCSIDeviceInfo {
|
||||||
scsi_qdev_initfn init;
|
scsi_qdev_initfn init;
|
||||||
void (*destroy)(SCSIDevice *s);
|
void (*destroy)(SCSIDevice *s);
|
||||||
SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
|
SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
|
||||||
void *hba_private);
|
uint8_t *buf, void *hba_private);
|
||||||
void (*unit_attention_reported)(SCSIDevice *s);
|
void (*unit_attention_reported)(SCSIDevice *s);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue