qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v3 6/8] block: add options parameter to bdrv


From: Manos Pitsidianakis
Subject: Re: [Qemu-devel] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()
Date: Wed, 28 Jun 2017 16:47:24 +0300
User-agent: NeoMutt/20170609-57-1e93be (1.8.3)

On Wed, Jun 28, 2017 at 03:42:41PM +0200, Alberto Garcia wrote:
On Fri 23 Jun 2017 02:46:58 PM CEST, Manos Pitsidianakis wrote:
 BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_name,
-                                       int flags, Error **errp)
+                                       int flags, QDict *options, Error **errp)
 {
     BlockDriverState *bs;
     int ret;

     bs = bdrv_new();
     bs->open_flags = flags;
-    bs->explicit_options = qdict_new();
-    bs->options = qdict_new();
+    if (options) {
+        bs->explicit_options = qdict_clone_shallow(options);
+        bs->options = qdict_clone_shallow(options);
+    } else {
+        bs->explicit_options = qdict_new();
+        bs->options = qdict_new();
+    }
     bs->opaque = NULL;

     update_options_from_flags(bs->options, flags);

-    ret = bdrv_open_driver(bs, drv, node_name, bs->options, flags, errp);
+    ret = bdrv_open_driver(bs, drv, node_name, options, flags, errp);

Why this last change? In the default case you're now passing NULL
instead of the QDict created with qdict_new().

Duh, nice catch!

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]