aurel32 89c0f6438d scsi-generic: correct error management
this patch allows to fully use a tape device connected to qemu through
the scsi-generic interface.

Previous patch introduced tape SCSI commands management, this one
improve error case management:

- the SCSI controller command completion must be called with the status
value, not the sense value. In the case of scsi-generic, the SCSI status
is given by the field status of sg_io_hdr_t (the value is left shifted
by one regarding status codes defined in /usr/include/scsi/scsi.h)

- when a read is aborted due to a mark/EOF/EOD/EOM, the len reported to
controller can be 0. LSI controller emulation doesn't know how to manage
this. A workaround found is to call the completion routine with
SCSI_REASON_DONE just after calling it with SCSI_REASON_DATA with len=0.

This patch also manages correctly the block size of the tape device.

This patch has been tested with a real tape device "HP C5683A", linux
guest (debian etch) and tools like "mt", "tar" and "btape".

Windows guest is not better supported than before...

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5497 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-17 08:08:56 +00:00
..
2008-06-21 17:14:50 +00:00
2008-09-02 00:09:25 +00:00
2007-11-17 17:14:51 +00:00
2008-05-12 16:13:33 +00:00
2008-07-02 16:48:32 +00:00
2007-11-17 17:14:51 +00:00
2008-07-02 16:48:32 +00:00
2007-11-17 17:14:51 +00:00
2008-06-13 10:48:22 +00:00
2008-04-08 06:01:02 +00:00
2008-04-08 06:01:02 +00:00
2008-04-14 21:57:44 +00:00
2007-11-17 17:14:51 +00:00
2008-05-12 16:13:33 +00:00
2008-06-21 17:15:00 +00:00
2007-11-17 17:14:51 +00:00
2008-03-13 19:23:00 +00:00
2008-04-11 04:55:07 +00:00
2008-10-02 19:14:17 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2008-06-21 17:14:50 +00:00
2008-10-02 19:14:17 +00:00
2008-03-21 18:05:23 +00:00
2004-11-07 18:04:02 +00:00
2004-11-07 18:04:02 +00:00
2008-10-04 07:22:29 +00:00
2008-08-17 01:44:53 +00:00
2008-08-17 01:44:53 +00:00
2007-11-17 17:14:51 +00:00
2008-03-10 00:12:14 +00:00
2008-07-05 13:40:58 +00:00
2007-11-17 17:14:51 +00:00
2008-10-13 03:07:56 +00:00
2008-07-01 23:16:53 +00:00
2007-11-18 14:36:08 +00:00
2007-11-17 17:14:51 +00:00
2008-09-22 16:30:29 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-12-02 02:20:03 +00:00
2008-09-20 01:10:32 +00:00
2008-07-21 19:52:54 +00:00
2008-07-21 19:52:54 +00:00
2008-09-20 01:10:32 +00:00
2007-11-17 17:14:51 +00:00
2008-08-22 08:57:09 +00:00
2008-09-28 00:42:12 +00:00
2008-10-02 18:33:50 +00:00
2007-11-17 17:14:51 +00:00
2008-10-02 19:14:17 +00:00
2007-11-17 17:14:51 +00:00
2008-06-09 00:20:13 +00:00
2008-07-02 16:48:32 +00:00
2008-07-02 16:48:32 +00:00
2007-11-17 17:14:51 +00:00
2008-07-02 16:48:32 +00:00
2007-11-24 23:35:08 +00:00
2008-05-25 10:10:12 +00:00
2008-10-04 07:20:07 +00:00
2008-10-04 07:20:07 +00:00
2007-11-17 17:14:51 +00:00
2008-10-04 07:20:07 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-24 23:35:08 +00:00
2007-11-17 17:14:51 +00:00
2008-10-02 19:14:17 +00:00
2007-11-24 23:55:52 +00:00
2007-11-17 17:14:51 +00:00
2008-10-02 19:14:17 +00:00
2008-04-07 19:47:14 +00:00
2008-06-02 00:55:08 +00:00
2008-04-14 21:05:22 +00:00
2007-11-17 17:14:51 +00:00
2008-09-02 16:18:28 +00:00
2008-09-15 07:05:18 +00:00
2008-05-12 16:13:33 +00:00
2008-05-10 10:12:00 +00:00
2008-07-02 15:17:21 +00:00
2008-05-12 16:13:33 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2008-07-07 23:01:25 +00:00
2008-07-07 23:01:25 +00:00
2008-07-02 16:48:32 +00:00
2008-05-12 16:13:33 +00:00
2008-05-10 10:12:00 +00:00
2008-06-09 14:31:18 +00:00
2008-10-02 19:14:17 +00:00
2008-10-02 19:14:17 +00:00
2008-10-02 19:14:17 +00:00
2008-04-22 03:15:10 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2008-04-22 03:15:10 +00:00
2007-11-17 17:14:51 +00:00
2007-11-17 17:14:51 +00:00
2008-10-11 17:37:25 +00:00
2007-11-17 17:14:51 +00:00