[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/7] block: Update bs->open_flags earlier in bdrv
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH v2 3/7] block: Update bs->open_flags earlier in bdrv_open_common() |
Date: |
Thu, 15 Sep 2016 17:53:01 +0300 |
We're only doing this immediately before opening the image, but
bs->open_flags is used earlier in the function. At the moment this is
not causing problems because none of the checked flags are modified by
update_flags_from_options(), but this will change when we introduce
the "read-only" option.
This patch calls update_flags_from_options() at the beginning of the
function, immediately after creating the QemuOpts.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
---
block.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 7cae841..f56d703 100644
--- a/block.c
+++ b/block.c
@@ -913,6 +913,8 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild
*file,
goto fail_opts;
}
+ update_flags_from_options(&bs->open_flags, opts);
+
driver_name = qemu_opt_get(opts, "driver");
drv = bdrv_find_format(driver_name);
assert(drv != NULL);
@@ -974,9 +976,6 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild
*file,
bs->drv = drv;
bs->opaque = g_malloc0(drv->instance_size);
- /* Apply cache mode options */
- update_flags_from_options(&bs->open_flags, opts);
-
/* Open the image, either directly or using a protocol */
open_flags = bdrv_open_flags(bs, bs->open_flags);
if (drv->bdrv_file_open) {
--
2.9.3
- [Qemu-devel] [PATCH v2 0/7] Add "read-only" to the options QDict, Alberto Garcia, 2016/09/15
- [Qemu-devel] [PATCH v2 1/7] block: Remove bdrv_is_snapshot, Alberto Garcia, 2016/09/15
- [Qemu-devel] [PATCH v2 2/7] block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags, Alberto Garcia, 2016/09/15
- [Qemu-devel] [PATCH v2 6/7] commit: Add 'base' to the reopen queue before 'overlay_bs', Alberto Garcia, 2016/09/15
- [Qemu-devel] [PATCH v2 5/7] block: Don't queue the same BDS twice in bdrv_reopen_queue_child(), Alberto Garcia, 2016/09/15
- [Qemu-devel] [PATCH v2 7/7] block: rename "read-only" to BDRV_OPT_READ_ONLY, Alberto Garcia, 2016/09/15
- [Qemu-devel] [PATCH v2 3/7] block: Update bs->open_flags earlier in bdrv_open_common(),
Alberto Garcia <=
- [Qemu-devel] [PATCH v2 4/7] block: Add "read-only" to the options QDict, Alberto Garcia, 2016/09/15
- Re: [Qemu-devel] [PATCH v2 0/7] Add "read-only" to the options QDict, Kevin Wolf, 2016/09/16