[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual adv
From: |
Liu Yuan |
Subject: |
Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual advertise |
Date: |
Wed, 11 Apr 2012 10:42:41 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 |
Hi Paolo,
On 04/11/2012 03:40 AM, Paolo Bonzini wrote:
>> From: Liu Yuan <address@hidden>
>> >
>> > The 'qemu-img convert -h' advertise that the default cache mode is
>> > 'writeback', while in fact it is 'unsafe'.
>> >
>> > This patch 1) changes the cache mode as 'writeback' and 2) explicitly
>> > calls bdrv_flush() to flush the dirty bits.
>> >
>> > 2) is needed because some backend storage doesn't have a self-flush
>> > mechanism(for e.g., sheepdog), so we need to call bdrv_flush() to make
>> > sure the image is really writen to the storage instead of hanging around
>> > writeback cache forever.
> Shouldn't the close method do that then?
I'd insist using bdrv_flush() instead of bdrv_close() because
1) if we use bdrv_close(), we rely on the assumption that backend
storage will do flushing while interpreting this operation. This
assumption might not always hold, for e.g, current sheepdog doesn't do
flushing for bdrv_close(). So bdrv_flush() will be the safest method to
push the data back.
2) explicit flushing is more maintainable, we don't need to guess if it
does flushing internally if we use other function that flush implicitly.
Thanks,
Yuan
Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual advertise, Kevin Wolf, 2012/04/11
- Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual advertise, Liu Yuan, 2012/04/11
- Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual advertise, Kevin Wolf, 2012/04/11
- Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual advertise, Kevin Wolf, 2012/04/11
- Re: [Qemu-devel] [PATCH] qemu-img: let qemu-img behave as the manual advertise, Liu Yuan, 2012/04/11
- [Qemu-devel] [PATCH v2] qemu-img: let 'qemu-img convert' flush data, Liu Yuan, 2012/04/11
- Re: [Qemu-devel] [PATCH v2] qemu-img: let 'qemu-img convert' flush data, Paolo Bonzini, 2012/04/11