[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xen_disk: support cache backend option
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH] xen_disk: support cache backend option |
Date: |
Wed, 26 Jun 2013 22:42:20 +0100 |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Wed, 26 Jun 2013, Paolo Bonzini wrote:
> Il 26/06/2013 19:48, Stefano Stabellini ha scritto:
> > + if (!strcmp(blkdev->cache, "none")) {
> > + qflags = BDRV_O_NATIVE_AIO | BDRV_O_NOCACHE;
> > + } else if (!strcmp(blkdev->cache, "writethrough")) {
> > + qflags = 0;
> > + } else {
> > + /* default to writeback */
> > + qflags = BDRV_O_NATIVE_AIO | BDRV_O_CACHE_WB;
> > + }
>
> You can use bdrv_parse_cache_flags.
I didn't want to call to bdrv_parse_cache_flags because the options are
slightly different (they are a subset) and they are going to become
part of the block interface, so the parsing could diverge in the future.
However as of today I could call bdrv_parse_cache_flags and it would
work fine.
> Note that BDRV_O_NATIVE_AIO
> requires BDRV_O_NOCACHE too (but if you only specify BDRV_O_NATIVE_AIO
> it's a no-op, not an error).
Yeah, good point, I might as well remove it from there.