All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH] block: Fix cache mode defaults in bds_tree_init()
Date: Mon, 7 Mar 2016 08:50:55 -0700	[thread overview]
Message-ID: <56DDA35F.2030308@redhat.com> (raw)
In-Reply-To: <1457358136-22346-1-git-send-email-kwolf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

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 <kwolf@redhat.com>
> ---
>  blockdev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> 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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2016-03-07 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 13:42 [Qemu-devel] [PATCH] block: Fix cache mode defaults in bds_tree_init() Kevin Wolf
2016-03-07 15:50 ` Eric Blake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56DDA35F.2030308@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.