diff options
author | Kevin Wolf <kwolf@redhat.com> | 2019-04-04 17:04:43 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-04-08 16:48:46 +0200 |
commit | 3f48686faca1856d74c244b151da1d3a521ef967 (patch) | |
tree | 07c949b754c73f01d830c1d0dc869e5bfe1b69ca /block.c | |
parent | f55a585d1037e5de6088f25e75443c2776786e29 (diff) |
block: Forward 'discard' to temporary overlay
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: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 */ |