qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 12/19] block/iscsi: check WRITE SAME support


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 12/19] block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP
Date: Mon, 25 Nov 2013 11:42:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]