[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
- [Qemu-devel] [PATCH v3 09/19] block drivers: expose requirement for write same alignment from formats, (continued)
- [Qemu-devel] [PATCH v3 09/19] block drivers: expose requirement for write same alignment from formats, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 08/19] block drivers: add discard/write_zeroes properties to bdrv_get_info implementation, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 10/19] block/iscsi: remove .bdrv_has_zero_init, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 06/19] block: make bdrv_co_do_write_zeroes stricter in producing aligned requests, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 11/19] block/iscsi: updated copyright, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 12/19] block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 13/19] raw-posix: implement write_zeroes with MAY_UNMAP for files, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 14/19] raw-posix: implement write_zeroes with MAY_UNMAP for block devices, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 15/19] raw-posix: add support for write_zeroes on XFS and block devices, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 16/19] qemu-iotests: 033 is fast, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 17/19] scsi-disk: catch write protection errors in UNMAP, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 18/19] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands, Paolo Bonzini, 2013/11/22
- [Qemu-devel] [PATCH v3 19/19] scsi-disk: correctly implement WRITE SAME, Paolo Bonzini, 2013/11/22