qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 3/3] block: Removed unused sector-based blocking


From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH 3/3] block: Removed unused sector-based blocking I/O
Date: Thu, 03 May 2018 15:36:34 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Fri 27 Apr 2018 05:43:33 PM CEST, Eric Blake wrote:
>>> -static int bdrv_rw_co(BdrvChild *child, int64_t sector_num, uint8_t *buf,
>>> -                      int nb_sectors, bool is_write, BdrvRequestFlags 
>>> flags)
>>> -{
>>> -    QEMUIOVector qiov;
>>> -    struct iovec iov = {
>>> -        .iov_base = (void *)buf,
>>> -        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,
>>> -    };
>>> -
>>> -    if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {
>>> -        return -EINVAL;
>>> -    }
>> 
>> Do we have a check for BDRV_REQUEST_MAX_BYTES in the byte-based API?
>
> No, but we don't need one.  First, note that bs->bl.max_transfer is
> currently uint32_t, so right now, no driver can set it any larger than
> 4G

But note that the old limit was based on a signed integer.

BDRV_REQUEST_MAX_SECTORS is 2147483136 bytes (a bit less than 2GB).

For 32-bit integers, (INT_MAX - 1) & ~511 = 2147483136

Berto



reply via email to

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