qemu-block
[Top][All Lists]
Advanced

[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



reply via email to

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