qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MA


From: Peter Lieven
Subject: Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices
Date: Wed, 13 Nov 2013 15:45:45 +0100


> Am 13.11.2013 um 15:39 schrieb Paolo Bonzini <address@hidden>:
> 
> Il 13/11/2013 15:14, Peter Lieven ha scritto:
>>>>>> does BLKDISCARDZEROES ioctl guarantee that a device is
>>>>>> zero initialized or does it just guarantee that a discard may not
>>>>>> fail and that it reads as zeroes afterwards?
>>>> 
>>>> Only the latter.  ".bdrv_has_zero_init" is only present in the bdrv_file
>>>> BlockDriver.
>> Then bdi->unallocated_blocks_are_zero must stay 0. .bdrv_has_zero_init's
>> semantic is to reflect the zero status of all blocks of the device right 
>> after bdrv_create
>> independently of their allocation status. bdi->unallocated_blocks_are_zero
>> reflects the zero status of every unallocated block regardless if it was
>> unallocated right from the beginning or became unallocated through a discard.
> 
> What we have is:
> 
> * bdi->unallocated_blocks_are_zero returns true
> 
> * bdrv_create doesn't ensure that every block starts unallocated
> 
> * hence bdrv_has_zero_init returns false
> 
> Blocks that (for any reason) are unallocated after bdrv_create *will* be
> zero if BLKDISCARDZEROES returns true.

Ok, then i misunderstood your comment. If BLKDISCARDZEROES means lbprz == 1 
SCSI speaking then you are right.

Peter

> 
> Paolo



reply via email to

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