All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-4.0] block: Forward 'discard' to temporary overlay
@ 2019-04-04 15:07 Kevin Wolf
  2019-04-04 15:18 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kevin Wolf @ 2019-04-04 15:07 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mreitz, qemu-devel

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(-)

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 */
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.0] block: Forward 'discard' to temporary overlay
  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
  2019-04-04 15:38 ` Stefano Garzarella
  2019-04-05  7:36   ` Alberto Garcia
  2 siblings, 0 replies; 5+ messages in thread
From: Eric Blake @ 2019-04-04 15:18 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: qemu-devel, mreitz

[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.0] block: Forward 'discard' to temporary overlay
  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
@ 2019-04-04 15:38 ` Stefano Garzarella
  2019-04-05  7:36   ` Alberto Garcia
  2 siblings, 0 replies; 5+ messages in thread
From: Stefano Garzarella @ 2019-04-04 15:38 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, qemu-devel, mreitz

On Thu, Apr 04, 2019 at 05:07:46PM +0200, 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: Stefano Garzarella <sgarzare@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH for-4.0] block: Forward 'discard' to temporary overlay
@ 2019-04-05  7:36   ` Alberto Garcia
  0 siblings, 0 replies; 5+ messages in thread
From: Alberto Garcia @ 2019-04-05  7:36 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: qemu-devel, mreitz

On Thu 04 Apr 2019 05:07:46 PM CEST, 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>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH for-4.0] block: Forward 'discard' to temporary overlay
@ 2019-04-05  7:36   ` Alberto Garcia
  0 siblings, 0 replies; 5+ messages in thread
From: Alberto Garcia @ 2019-04-05  7:36 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: kwolf, qemu-devel, mreitz

On Thu 04 Apr 2019 05:07:46 PM CEST, 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>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-05  7:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.