Il 25/11/2013 11:34, Peter Lieven ha scritto: >> @@ -1012,6 +1018,14 @@ retry: >> } >> if (iTask.status != SCSI_STATUS_GOOD) { >> + 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) { >> + /* WRITE SAME is not supported by the target */ >> + iscsilun->has_write_same = false; >> + return -ENOTSUP; >> + } >> + >> return -EIO; >> } >> @@ -1375,6 +1389,7 @@ static int iscsi_open(BlockDriverState *bs, >> QDict *options, int flags, >> } >> iscsilun->type = inq->periperal_device_type; >> + iscsilun->has_write_same = true; >> if ((ret = iscsi_readcapacity_sync(iscsilun)) != 0) { >> goto out; > > Maybe the naming has_write_same is misleading. It might be better to call > it try_write_same or has_write_same_failed with inverse logic.
I was using the same names as block/raw-posix.c. I'm not sure I like the other names, but if the maintainers prefer them I'll gladly change them. Paolo