qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 02/16] block: Set dirty before doing write


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 02/16] block: Set dirty before doing write
Date: Tue, 26 Jan 2016 10:52:51 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 01/26/2016 03:38 AM, Fam Zheng wrote:
> So that driver can write the dirty bits into persistent dirty bitmaps in
> the write callback.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block/io.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <address@hidden>

> 
> diff --git a/block/io.c b/block/io.c
> index 343ff1f..b964e7e 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -1164,6 +1164,8 @@ static int coroutine_fn 
> bdrv_aligned_pwritev(BlockDriverState *bs,
>          }
>      }
>  
> +    bdrv_set_dirty(bs, sector_num, nb_sectors);
> +
>      if (ret < 0) {
>          /* Do nothing, write notifier decided to fail this request */

This sets the dirty bit even on failure, but I guess that doesn't hurt
(it's better to mark too much dirty than it is to not mark enough).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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