aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-11-26 15:33:50 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:36 -0600
commit89b08ae15449fe433325061ebb928766a1c77381 (patch)
tree87543c67167a00d0d2d1b60e940b6afc6c41a3fc /hw/scsi.h
parent9af99d980e9ff6270f291b11a064087b33dd3ab8 (diff)
scsi: move SCSIRequest management to common code.
Create generic functions to allocate, find and release SCSIRequest structs. Make scsi-disk and scsi-generic use them. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index a9b846cc17..ceeb26ad4f 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -20,6 +20,7 @@ typedef struct SCSIRequest {
SCSIBus *bus;
SCSIDevice *dev;
uint32_t tag;
+ uint32_t lun;
BlockDriverAIOCB *aiocb;
QTAILQ_ENTRY(SCSIRequest) next;
} SCSIRequest;
@@ -74,4 +75,8 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit);
void scsi_bus_legacy_handle_cmdline(SCSIBus *bus);
+SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag, uint32_t lun);
+SCSIRequest *scsi_req_find(SCSIDevice *d, uint32_t tag);
+void scsi_req_free(SCSIRequest *req);
+
#endif