[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 1/2] ignore bdrv_flush operation when no qcow2 c
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH 1/2] ignore bdrv_flush operation when no qcow2 cache item is dirty |
Date: |
Mon, 20 Jul 2015 09:03:05 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
[patches should always be sent to qemu-devel, even if qemu-block is also
in the to/cc list]
On 07/08/2015 01:26 AM, Qingshu Chen wrote:
> qcow2_cache_flush() writes dirty cache to the disk and invokes bdrv_flush()
> to make the data durable. But even if there is no dirty cache,
> qcow2_cache_flush() would invoke bdrv_flush(). In fact, bdrv_flush() will
> invoke fdatasync(), and it is an expensive operation. The patch will not
> invoke bdrv_flush if there is not dirty cache. The reason that I modify the
> return value of qcow2_cache_flush() is qcow2_co_flush_to_os needs to know
> whether flush operation is called. Following is the patch:
>
>>From 23f9f83da4178e8fbb53d2cffe128f5a2d3a239a Mon Sep 17 00:00:00 2001
> From: Qingshu Chen <address@hidden>
> Date: Wed, 1 Jul 2015 14:45:23 +0800
> Subject: [PATCH 1/2] ignore bdrv_flush operation when no qcow2 cache item is
> dirty
> Signed-off-by: Qingshu Chen <address@hidden>
I didn't quickly find an associated 2/2 patch; are you sure you sent the
series correctly?
>
> ---
> block/qcow2-cache.c | 9 ++++++++-
> block/qcow2.c | 2 ++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
> index ed92a09..57c0601 100644
> --- a/block/qcow2-cache.c
> +++ b/block/qcow2-cache.c
> @@ -174,6 +174,7 @@ int qcow2_cache_flush(BlockDriverState *bs, Qcow2Cache
> *c)
> int result = 0;
> int ret;
> int i;
> + int flag = 0;
This is used as a bool, so declare it as such (bool flag = false;).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature