[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work i
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated() |
Date: |
Wed, 5 Jul 2017 22:21:24 +0800 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Wed, 07/05 09:01, Eric Blake wrote:
> On 07/05/2017 07:07 AM, Fam Zheng wrote:
> >>>
> >>> Sorry for bikeshedding.
> >>
> >> Not a problem, I also had some double-takes in writing my own code
> >> trying to remember which way I wanted the 'allocation' boolean to be
> >> set, so coming up with a more intuitive name/default state in order to
> >> help legibility is worth it. Do any of my above suggestions sound better?
> >>
> >
> > I'd vote for "mapping" because it has a close connection with offset (as in
> > BDRV_BLOCK_OFFSET_VALID).
> >
> > Or simply call it "offset" and if false, never return
> > BDRV_BLOCK_OFFSET_VALID.
>
> Well, there ARE drivers that WANT to return BDRV_BLOCK_OFFSET_VALID
> regardless of the state of the boolean (namely, any driver that also
> returns BDRV_BLOCK_RAW, to hint that this is a passthrough and the query
> should be repeated at the next BDS in the chain). So stating that
> 'offset' is false MUST preclude BDRV_BLOCK_OFFSET_VALID is a bit too
> strong, but I can probably come up with appropriate wording that meets
> in the middle ground (if 'offset' is true, then make all efforts to
> include BDRV_BLOCK_OFFSET_VALID in the return if that is possible; if it
> is false, then omitting the flag in order to get a larger pnum is
> acceptable)).
Yes you are totally right, I thought that too after replied.
Fam
- [Qemu-devel] [PATCH v2 01/15] block: add default implementations for bdrv_co_get_block_status(), (continued)
- [Qemu-devel] [PATCH v2 01/15] block: add default implementations for bdrv_co_get_block_status(), Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 04/15] block: Make bdrv_round_to_clusters() signature more useful, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated(), Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status(), Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 05/15] qcow2: Switch is_zero_sectors() to byte-based, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 06/15] block: Switch bdrv_make_zero() to byte-based, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 07/15] qemu-img: Switch get_block_status() to byte-based, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 08/15] block: Convert bdrv_get_block_status() to bytes, Eric Blake, 2017/07/03