qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vvfat: Fix qcow write target driver specification
@ 2016-07-11 13:54 Max Reitz
  2016-07-11 14:06 ` Eric Blake
  2016-07-11 14:13 ` Kevin Wolf
  0 siblings, 2 replies; 3+ messages in thread
From: Max Reitz @ 2016-07-11 13:54 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Kevin Wolf

First, bdrv_open_child() expects all options for the child to be
prefixed by the child's name (and a separating dot). Second,
bdrv_open_child() does not take ownership of the QDict passed to it but
only extracts all options for the child, so if a QDict is created for
the sole purpose of passing it to bdrv_open_child(), it needs to be
freed afterwards.

This patch makes vvfat adhere to both of these rules.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/vvfat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/vvfat.c b/block/vvfat.c
index c3f24c6..ba2620f 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -3018,9 +3018,10 @@ static int enable_write_target(BlockDriverState *bs, Error **errp)
     }
 
     options = qdict_new();
-    qdict_put(options, "driver", qstring_from_str("qcow"));
+    qdict_put(options, "write-target.driver", qstring_from_str("qcow"));
     s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
                               &child_vvfat_qcow, false, errp);
+    QDECREF(options);
     if (!s->qcow) {
         ret = -EINVAL;
         goto err;
-- 
2.9.0

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

* Re: [Qemu-devel] [PATCH] vvfat: Fix qcow write target driver specification
  2016-07-11 13:54 [Qemu-devel] [PATCH] vvfat: Fix qcow write target driver specification Max Reitz
@ 2016-07-11 14:06 ` Eric Blake
  2016-07-11 14:13 ` Kevin Wolf
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2016-07-11 14:06 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel

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

On 07/11/2016 07:54 AM, Max Reitz wrote:
> First, bdrv_open_child() expects all options for the child to be
> prefixed by the child's name (and a separating dot). Second,
> bdrv_open_child() does not take ownership of the QDict passed to it but
> only extracts all options for the child, so if a QDict is created for
> the sole purpose of passing it to bdrv_open_child(), it needs to be
> freed afterwards.
> 
> This patch makes vvfat adhere to both of these rules.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/vvfat.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

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

> 
> diff --git a/block/vvfat.c b/block/vvfat.c
> index c3f24c6..ba2620f 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -3018,9 +3018,10 @@ static int enable_write_target(BlockDriverState *bs, Error **errp)
>      }
>  
>      options = qdict_new();
> -    qdict_put(options, "driver", qstring_from_str("qcow"));
> +    qdict_put(options, "write-target.driver", qstring_from_str("qcow"));
>      s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
>                                &child_vvfat_qcow, false, errp);
> +    QDECREF(options);
>      if (!s->qcow) {
>          ret = -EINVAL;
>          goto err;
> 

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

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

* Re: [Qemu-devel] [PATCH] vvfat: Fix qcow write target driver specification
  2016-07-11 13:54 [Qemu-devel] [PATCH] vvfat: Fix qcow write target driver specification Max Reitz
  2016-07-11 14:06 ` Eric Blake
@ 2016-07-11 14:13 ` Kevin Wolf
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2016-07-11 14:13 UTC (permalink / raw)
  To: Max Reitz; +Cc: qemu-block, qemu-devel

Am 11.07.2016 um 15:54 hat Max Reitz geschrieben:
> First, bdrv_open_child() expects all options for the child to be
> prefixed by the child's name (and a separating dot). Second,
> bdrv_open_child() does not take ownership of the QDict passed to it but
> only extracts all options for the child, so if a QDict is created for
> the sole purpose of passing it to bdrv_open_child(), it needs to be
> freed afterwards.
> 
> This patch makes vvfat adhere to both of these rules.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

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

end of thread, other threads:[~2016-07-11 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 13:54 [Qemu-devel] [PATCH] vvfat: Fix qcow write target driver specification Max Reitz
2016-07-11 14:06 ` Eric Blake
2016-07-11 14:13 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).