[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/20] qemu-img: Call blk_set_enable_write_cache
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 05/20] qemu-img: Call blk_set_enable_write_cache() explicitly |
Date: |
Sat, 26 Mar 2016 18:54:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
On 18.03.2016 19:21, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qemu-img.c | 79
> ++++++++++++++++++++++++++++++++++++++------------------------
> 1 file changed, 48 insertions(+), 31 deletions(-)
>
> diff --git a/qemu-img.c b/qemu-img.c
> index 839e05b..96b51d4 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
[...]
> @@ -2862,26 +2874,30 @@ static int img_rebase(int argc, char **argv)
> qemu_progress_print(0, 100);
>
> flags = BDRV_O_RDWR | (unsafe ? BDRV_O_NO_BACKING : 0);
> - ret = bdrv_parse_cache_flags(cache, &flags);
> + ret = bdrv_parse_cache_mode(cache, &flags, &writethrough);
> if (ret < 0) {
> error_report("Invalid cache option: %s", cache);
> goto out;
> }
>
> - src_flags = BDRV_O_CACHE_WB;
> - ret = bdrv_parse_cache_flags(src_cache, &src_flags);
> + src_flags = 0;
> + ret = bdrv_parse_cache_mode(src_cache, &src_flags, &src_writethrough);
> if (ret < 0) {
> error_report("Invalid source cache option: %s", src_cache);
> goto out;
> }
>
> + /* The source files are opened read-only, don't care about WCE */
> + assert((src_writethrough & BDRV_O_RDWR) == 0);
Well, yeah, that is a trivial assertion to make because BDRV_O_RDWR is 2.
I guess you meant s/src_writethrough/src_flags/.
With that fixed:
Reviewed-by: Max Reitz <address@hidden>
> + (void) src_writethrough;
> +
> /*
> * Open the images.
> *
> * Ignore the old backing file for unsafe rebase in case we want to
> correct
> * the reference to a renamed or moved backing file.
> */
> - blk = img_open(image_opts, filename, fmt, flags, true, quiet);
> + blk = img_open(image_opts, filename, fmt, flags, true, writethrough,
> quiet);
> if (!blk) {
> ret = -1;
> goto out;
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 04/20] qemu-img: Expand all BDRV_O_FLAGS uses, (continued)
- [Qemu-devel] [PATCH 04/20] qemu-img: Expand all BDRV_O_FLAGS uses, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 03/20] qemu-io: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 06/20] xen_disk: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 09/20] block: Handle flush error in bdrv_pwrite_sync(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 05/20] qemu-img: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/18
- Re: [Qemu-devel] [PATCH 05/20] qemu-img: Call blk_set_enable_write_cache() explicitly,
Max Reitz <=
- [Qemu-devel] [PATCH 07/20] block: blockdev_init(): Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 08/20] block: Always set writeback mode in blk_new_open(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 10/20] block: Move enable_write_cache to BB level, Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 16/20] block: Use bdrv_parse_cache_mode() in drive_init(), Kevin Wolf, 2016/03/18
- [Qemu-devel] [PATCH 15/20] raw: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/18