[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 06/33] block: Update bs->open_flags earlier in bdrv_o
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 06/33] block: Update bs->open_flags earlier in bdrv_open_common() |
Date: |
Thu, 22 Sep 2016 18:29:07 +0200 |
From: Alberto Garcia <address@hidden>
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>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 324dbe7..a98b75e 100644
--- a/block.c
+++ b/block.c
@@ -961,6 +961,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);
@@ -1022,9 +1024,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) {
--
1.8.3.1
- [Qemu-block] [PULL 00/33] Block layer patches, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 02/33] hmp: Remove dead code in hmp_qemu_io(), Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 01/33] qcow2: fix encryption during cow of sectors, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 05/33] block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 06/33] block: Update bs->open_flags earlier in bdrv_open_common(),
Kevin Wolf <=
- [Qemu-block] [PULL 03/33] tests: allow to specify list of formats to test for check-block.sh, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 04/33] block: Remove bdrv_is_snapshot, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 07/33] block: Add "read-only" to the options QDict, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 08/33] block: Don't queue the same BDS twice in bdrv_reopen_queue_child(), Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 09/33] commit: Add 'base' to the reopen queue before 'overlay_bs', Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 10/33] block: rename "read-only" to BDRV_OPT_READ_ONLY, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 11/33] block: Fix 'since' for compressed Drive/BlockdevBackup, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 12/33] block: Add blk_by_dev(), Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 13/33] qdev-monitor: Factor out find_device_state(), Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 14/33] qdev-monitor: Add blk_by_qdev_id(), Kevin Wolf, 2016/09/22