[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] bogus bdrv_check_request in bdrv_co_discard
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] bogus bdrv_check_request in bdrv_co_discard |
Date: |
Wed, 9 Mar 2016 13:29:48 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 09/03/2016 13:11, Olaf Hering wrote:
> What is the purpose of the bdrv_check_request() call in bdrv_co_discard?
>
> It seems a frontend cant possibly know what the limit is in the
> qemu-of-the-day, I found no interface to propagate
> BDRV_REQUEST_MAX_SECTORS into the guest.
It depends on the backend. For example SCSI uses the block limits VPD
page. It has a default max-unmap-size of 1 GiB, which happens to be
smaller than BDRV_REQUEST_MAX_SECTORS too.
It probably should range check max_unmap_size and max_io_size against
BDRV_REQUEST_MAX_SECTORS, and reject anything bigger than that, though.
Paolo
> I think to handle nb_sectors > BDRV_REQUEST_MAX_SECTORS bdrv_co_discard
> has to split the request into smaller chunks, just as it does a few
> lines down in the function.