qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 12/21] block: define get_block_status return


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v5 12/21] block: define get_block_status return value
Date: Tue, 6 May 2014 13:34:30 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 05.05.2014 um 16:58 hat Paolo Bonzini geschrieben:
> Il 05/05/2014 16:34, Kevin Wolf ha scritto:
> > I think we're missing the information whether the BDRV_BLOCK_ZERO flag
> > actually comes from bs itself or from the backing chain. Do we need
> > another flag or does someone have a better idea?
> 
> Not sure if it is a better idea :) but we can duplicate the logic of
> bdrv_get_co_block_status in bdrv_is_allocated.
> 
> The observation here is that bdrv_has_zero_init should have been 
> changed to bdrv_unallocated_blocks_are_zero in commit c3d8688
> (block/get_block_status: fix BDRV_BLOCK_ZERO for unallocated blocks,
> 2013-10-24); the logic in the commit message applies just as well to
> bdrv_is_allocated.

But the result still wouldn't be right. We have an implication that you
can't simply reverse:

    If this block is unallocated and unallocated blocks read as zero,
    then this block reads as zero.

You're trying to use something like "If the block reads as zero and
unallocated blocks read as zero, it must be unallocated", which quite
obviously doesn't work.

Kevin



reply via email to

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