aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-26 21:53:41 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-26 21:53:41 +0000
commit0fc5c15a4fad2dac00126c802554d9ca33c4ccc7 (patch)
treeebd1750330549b256692db5d2613c5d259f5d8d5 /hw/scsi-disk.c
parentcac782d496c0160aba9ae8df53a3504599a4c721 (diff)
SCSI lun probing fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1945 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 9285c18cea..c15486b2bf 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -53,7 +53,7 @@ struct SCSIDevice
static void scsi_command_complete(SCSIDevice *s, int sense)
{
s->sense = sense;
- s->completion(s->opaque, s->tag, sense != SENSE_NO_SENSE);
+ s->completion(s->opaque, s->tag, sense);
}
/* Read data from a scsi device. Returns nonzero on failure. */
@@ -175,7 +175,7 @@ int scsi_write_data(SCSIDevice *s, uint8_t *data, uint32_t len)
(eg. disk reads), negative for transfers to the device (eg. disk writes),
and zero if the command does not transfer any data. */
-int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf)
+int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf, int lun)
{
int64_t nb_sectors;
uint32_t lba;
@@ -225,8 +225,9 @@ int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf)
printf("\n");
}
#endif
- if (buf[1] >> 5) {
+ if (lun || buf[1] >> 5) {
/* Only LUN 0 supported. */
+ DPRINTF("Unimplemented LUN %d\n", lun ? lun : buf[1] >> 5);
goto fail;
}
switch (s->command) {