aboutsummaryrefslogtreecommitdiffstats
path: root/hw/scsi-bus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-11-14 14:31:51 +0100
committerKevin Wolf <kwolf@redhat.com>2011-11-18 14:12:15 +0100
commitf3b338ef4afaba105357f62143491e51d35c5b42 (patch)
tree10ba3081b4048e6f42712a12373c0dca5914faf1 /hw/scsi-bus.c
parent0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0 (diff)
scsi: pass down REQUEST SENSE to the device when there is no stored sense
This will let scsi-block/scsi-generic report progress on long operations. Reported-by: Thomas Schmitt <scdbackup@gmxbackup.net> Tested-by: Thomas Schmitt <scdbackup@gmxbackup.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi-bus.c')
-rw-r--r--hw/scsi-bus.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 4d9ff35fd..3a2a7bb72 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -9,8 +9,6 @@
static char *scsibus_get_fw_dev_path(DeviceState *dev);
static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf);
static void scsi_req_dequeue(SCSIRequest *req);
-static int scsi_build_sense(uint8_t *in_buf, int in_len,
- uint8_t *buf, int len, bool fixed);
static struct BusInfo scsi_bus_info = {
.name = "SCSI",
@@ -502,7 +500,7 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
hba_private);
} else if (lun != d->lun ||
buf[0] == REPORT_LUNS ||
- buf[0] == REQUEST_SENSE) {
+ (buf[0] == REQUEST_SENSE && (d->sense_len || cmd.xfer < 4))) {
req = scsi_req_alloc(&reqops_target_command, d, tag, lun,
hba_private);
} else {