[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v2 07/17] block: Give nonzero resul
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v2 07/17] block: Give nonzero result to blk_get_max_transfer_length() |
Date: |
Thu, 16 Jun 2016 15:22:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 16/06/2016 07:25, Fam Zheng wrote:
>> > + assert(max_xfer_len);
>> > + stl_be_p(&r->buf[8], max_xfer_len);
>> > + /* Also take care of the opt xfer len. */
>> > + if (ldl_be_p(&r->buf[12]) > max_xfer_len) {
>> > + stl_be_p(&r->buf[12], max_xfer_len);
> Paolo: should we take s->blocksize into account? I missed it when I wrote this
> piece of code.
Hmm, the maximum and optimal transfer length is in logical blocks, so yes.
There is one thing that isn't great: at least Linux reads the capacity
before the block limits page, but we cannot know for sure that everyone
does it. I think it's a good idea to send a READ CAPACITY(10) at
startup, like we do in get_stream_blocksize. We only need it for the
blocksize, not for the capacity, so it's not necessary to use READ
CAPACITY(16).
The snooping is still necessary for the max_lba (which is used by
scsi_disk_dma_command), so we might as well keep the assignment to
s->blocksize in there too. But let's add a best effort READ
CAPACITY(10) at startup.
Paolo
- [Qemu-block] [PATCH v2 13/17] block: Set default request_alignment during bdrv_refresh_limits(), (continued)
- [Qemu-block] [PATCH v2 13/17] block: Set default request_alignment during bdrv_refresh_limits(), Eric Blake, 2016/06/14
- [Qemu-block] [PATCH v2 14/17] block: Switch transfer length bounds to byte-based, Eric Blake, 2016/06/14
- [Qemu-block] [PATCH v2 10/17] qcow2: Set request_alignment during .bdrv_refresh_limits(), Eric Blake, 2016/06/14
- [Qemu-block] [PATCH v2 07/17] block: Give nonzero result to blk_get_max_transfer_length(), Eric Blake, 2016/06/14
- [Qemu-block] [PATCH v2 17/17] block: Move request_alignment into BlockLimit, Eric Blake, 2016/06/14
- [Qemu-block] [PATCH v2 09/17] iscsi: Set request_alignment during .bdrv_refresh_limits(), Eric Blake, 2016/06/14
- [Qemu-block] [PATCH v2 16/17] block: Split bdrv_merge_limits() from bdrv_refresh_limits(), Eric Blake, 2016/06/14