qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] qemu-img: conditionally discard target on c


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 4/4] qemu-img: conditionally discard target on convert
Date: Thu, 18 Jul 2013 16:14:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Il 18/07/2013 15:55, ronnie sahlberg ha scritto:
>> > bdrv->write_zeroes will use writesame16 and set the unmap flag only if
>> > BDRV_MAY_DISCARD == 1 and BDRV_O_UNMAP == 1 and lbprz == 1.
> When you use WRITESAME16 you can ignore the lbprz flag.
> Just send a WRITESAME16 command with one block of data that is all set to 
> zero.
> If the unmap flag is set and if unmapped blocks read back the same as
> the block you provided (all zero)
> then it will unmap those blocks, where possible.

True, so the unmap flag can be set iff BDRV_MAY_DISCARD == 1.  block.c
can take care of checking BDRV_O_UNMAP.

Paolo

> All other blocks that can not be unmapped, or where unmapped blocks
> will not read back the same, will instead be overwritten by the
> provided all-zero block.
> 
> 




reply via email to

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