]> git.proxmox.com Git - mirror_qemu.git/commit - hw/usb/dev-storage.c
scsi: Use 'SCSIRequest' directly
authorHannes Reinecke <hare@suse.de>
Mon, 18 Apr 2011 10:35:39 +0000 (12:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 May 2011 10:14:15 +0000 (12:14 +0200)
commit5c6c0e513600ba57c3e73b7151d3c0664438f7b5
treef08a9d140398fc3558ab6112ab03cc3831fed6f7
parent11257187e122f1b33e4983b881a2b6009f5993ca
scsi: Use 'SCSIRequest' directly

Currently the SCSIRequest structure is abstracted away and cannot accessed
directly from the driver. This requires the handler to do a lookup on
an abstract 'tag' which identifies the SCSIRequest structure.

With this patch the SCSIRequest structure is exposed to the driver. This
allows use to use it directly as an argument to the SCSIDeviceInfo
callback functions and remove the lookup.

A new callback function 'alloc_req' is introduced matching 'free
req'; unref'ing to free up resources after use is moved into the
scsi_command_complete callbacks.

This temporarily introduces a leak of requests that are cancelled,
when they are removed from the queue and not from the driver.  This
is fixed later by introducing scsi_req_cancel.  That patch in turn
depends on this one, because the argument to scsi_req_cancel is a
SCSIRequest.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
hw/esp.c
hw/lsi53c895a.c
hw/scsi-bus.c
hw/scsi-disk.c
hw/scsi-generic.c
hw/scsi.h
hw/spapr_vscsi.c
hw/usb-msd.c