[Qemu-devel] [PATCH] vvfat: Fix inherit_options flags

Fam Zheng posted 1 patch 7 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180315034507.6341-1-famz@redhat.com
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test s390x passed
block/vvfat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] vvfat: Fix inherit_options flags
Posted by Fam Zheng 7 years, 7 months ago
Overriding flags violates the precedence rules of
bdrv_reopen_queue_child. Just like the read-only option, no-flush should
be put into the options. The same is done in bdrv_temp_snapshot_options.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/vvfat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/vvfat.c b/block/vvfat.c
index 4a17a49e12..1569783b0f 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -3129,7 +3129,7 @@ static void vvfat_qcow_options(int *child_flags, QDict *child_options,
                                int parent_flags, QDict *parent_options)
 {
     qdict_set_default_str(child_options, BDRV_OPT_READ_ONLY, "off");
-    *child_flags = BDRV_O_NO_FLUSH;
+    qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on");
 }
 
 static const BdrvChildRole child_vvfat_qcow = {
-- 
2.14.3


Re: [Qemu-devel] [PATCH] vvfat: Fix inherit_options flags
Posted by Eric Blake 7 years, 7 months ago
On 03/14/2018 10:45 PM, Fam Zheng wrote:
> Overriding flags violates the precedence rules of
> bdrv_reopen_queue_child. Just like the read-only option, no-flush should
> be put into the options. The same is done in bdrv_temp_snapshot_options.
> 
> Reported-by: Stefan Hajnoczi <stefanha@redhat.com
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>   block/vvfat.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

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

> diff --git a/block/vvfat.c b/block/vvfat.c
> index 4a17a49e12..1569783b0f 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -3129,7 +3129,7 @@ static void vvfat_qcow_options(int *child_flags, QDict *child_options,
>                                  int parent_flags, QDict *parent_options)
>   {
>       qdict_set_default_str(child_options, BDRV_OPT_READ_ONLY, "off");
> -    *child_flags = BDRV_O_NO_FLUSH;
> +    qdict_set_default_str(child_options, BDRV_OPT_CACHE_NO_FLUSH, "on");
>   }
>   
>   static const BdrvChildRole child_vvfat_qcow = {
> 

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

Re: [Qemu-devel] [PATCH] vvfat: Fix inherit_options flags
Posted by Stefan Hajnoczi 7 years, 7 months ago
On Thu, Mar 15, 2018 at 11:45:07AM +0800, Fam Zheng wrote:
> Overriding flags violates the precedence rules of
> bdrv_reopen_queue_child. Just like the read-only option, no-flush should
> be put into the options. The same is done in bdrv_temp_snapshot_options.
> 
> Reported-by: Stefan Hajnoczi <stefanha@redhat.com

^--- please add the missing '>' when merging this patch

> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/vvfat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Re: [Qemu-devel] [PATCH] vvfat: Fix inherit_options flags
Posted by Kevin Wolf 7 years, 7 months ago
Am 15.03.2018 um 04:45 hat Fam Zheng geschrieben:
> Overriding flags violates the precedence rules of
> bdrv_reopen_queue_child. Just like the read-only option, no-flush should
> be put into the options. The same is done in bdrv_temp_snapshot_options.
> 
> Reported-by: Stefan Hajnoczi <stefanha@redhat.com
> Signed-off-by: Fam Zheng <famz@redhat.com>

Thanks, applied to the block branch.

Kevin