[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH] block: Fix cache mode defaults in
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH] block: Fix cache mode defaults in bds_tree_init() |
Date: |
Mon, 7 Mar 2016 08:50:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 03/07/2016 06:42 AM, Kevin Wolf wrote:
> Without setting explicit defaults in the options, blockdev-add without
> an ID ended up defaulting to writethrough. It should be writeback as
> documented.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> blockdev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
Reviewed-by: Eric Blake <address@hidden>
> diff --git a/blockdev.c b/blockdev.c
> index eecd78d..1824cae 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -675,6 +675,13 @@ static BlockDriverState *bds_tree_init(QDict *bs_opts,
> Error **errp)
> goto fail;
> }
>
> + /* bdrv_open() defaults to the values in bdrv_flags (for compatibility
> + * with other callers) rather than what we want as the real defaults.
> + * Apply the defaults here instead. */
> + qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_WB, "on");
> + qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_DIRECT, "off");
> + qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_NO_FLUSH, "off");
> +
> if (runstate_check(RUN_STATE_INMIGRATE)) {
> bdrv_flags |= BDRV_O_INACTIVE;
> }
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature