diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-08-03 10:49:08 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-12 08:27:36 -0500 |
commit | 8dbd4574882cade8261c2b6225df68a65345c75c (patch) | |
tree | 59101dbc9f0c5d838294da898122fe6e0c59881f /hw/scsi-bus.c | |
parent | b45ef674f4c403398e75c6be02e27a0bfa813a11 (diff) | |
download | qemu-8dbd4574882cade8261c2b6225df68a65345c75c.tar.gz qemu-8dbd4574882cade8261c2b6225df68a65345c75c.tar.bz2 qemu-8dbd4574882cade8261c2b6225df68a65345c75c.zip |
scsi: introduce SCSIReqOps
This will let allow requests to be dispatched through different callbacks,
either common or per-device.
This patch adjusts the API, the next one will move members to SCSIReqOps.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi-bus.c')
-rw-r--r-- | hw/scsi-bus.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index af956704e8..0ad466e37d 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -133,12 +133,12 @@ int scsi_bus_legacy_handle_cmdline(SCSIBus *bus) return res; } -SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag, +SCSIRequest *scsi_req_alloc(SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag, uint32_t lun, void *hba_private) { SCSIRequest *req; - req = qemu_mallocz(size); + req = qemu_mallocz(reqops->size); req->refcount = 1; req->bus = scsi_bus_from_device(d); req->dev = d; @@ -147,6 +147,7 @@ SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag, req->hba_private = hba_private; req->status = -1; req->sense_len = 0; + req->ops = reqops; trace_scsi_req_alloc(req->dev->id, req->lun, req->tag); return req; } |