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 for-4.0] block: Forward 'discard' to temporary overlay
Date: Thu, 4 Apr 2019 10:18:22 -0500	[thread overview]
Message-ID: <9333ae6f-dea1-d8b4-cdeb-39668efd2d56@redhat.com> (raw)
In-Reply-To: <20190404150746.12585-1-kwolf@redhat.com>

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

On 4/4/19 10:07 AM, Kevin Wolf wrote:
> When bdrv_temp_snapshot_options() is called for snapshot=on, the
> 'discard' option in the options QDict hasn't been parsed and merged into
> the flags yet. So copy the dict entry to make sure that the temporary
> overlay enables discard when it was requested for the drive.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

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

> 
> diff --git a/block.c b/block.c
> index 3050854528..16615bc876 100644
> --- a/block.c
> +++ b/block.c
> @@ -950,8 +950,9 @@ static void bdrv_temp_snapshot_options(int *child_flags, QDict *child_options,
>      qdict_set_default_str(child_options, BDRV_OPT_CACHE_DIRECT, "off");
>      qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on");
>  
> -    /* Copy the read-only option from the parent */
> +    /* Copy the read-only and discard options from the parent */
>      qdict_copy_default(child_options, parent_options, BDRV_OPT_READ_ONLY);
> +    qdict_copy_default(child_options, parent_options, BDRV_OPT_DISCARD);
>  
>      /* aio=native doesn't work for cache.direct=off, so disable it for the
>       * temporary snapshot */
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


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

  reply	other threads:[~2019-04-04 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 15:07 [Qemu-devel] [PATCH for-4.0] block: Forward 'discard' to temporary overlay Kevin Wolf
2019-04-04 15:18 ` Eric Blake [this message]
2019-04-04 15:38 ` Stefano Garzarella
2019-04-05  7:36 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2019-04-05  7:36   ` Alberto Garcia

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=9333ae6f-dea1-d8b4-cdeb-39668efd2d56@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.