diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-02 12:12:50 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-03 13:10:32 +0200 |
commit | 27898a5daa4c6d28adb32b401a011d7198494482 (patch) | |
tree | efa46d077088be6a0b87fcd8518c0d3be0ae51c5 | |
parent | d581eb7ca4b58649ade5fb7570ecf6b4b9a41879 (diff) | |
download | qemu-27898a5daa4c6d28adb32b401a011d7198494482.zip |
iscsi: recognize "invalid field" ASCQ from WRITE SAME command
Some targets may return "invalid field" as the ASCQ from WRITE SAME
if they support the command only without the UNMAP field. Recognize
that, and return ENOTSUP just like for "invalid operation code".
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | block/iscsi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index b490e98c05..2f96a8e037 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -838,7 +838,8 @@ retry: if (iTask.status == SCSI_STATUS_CHECK_CONDITION && iTask.task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST && - iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { + (iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE || + iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB)) { /* WRITE SAME is not supported by the target */ iscsilun->has_write_same = false; scsi_free_scsi_task(iTask.task); |