[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 09/21] block: Pass reference to bdrv_file_open()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 09/21] block: Pass reference to bdrv_file_open() |
Date: |
Wed, 11 Dec 2013 19:11:01 +0100 |
With that now being possible, bdrv_open() should try to extract a block
device reference from the options and pass it to bdrv_file_open().
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 9e197b3..4a2c251 100644
--- a/block.c
+++ b/block.c
@@ -1058,6 +1058,7 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
QDict *options,
char tmp_filename[PATH_MAX + 1];
BlockDriverState *file = NULL;
QDict *file_options = NULL;
+ const char *file_reference;
const char *drvname;
Error *local_err = NULL;
@@ -1144,9 +1145,11 @@ int bdrv_open(BlockDriverState *bs, const char
*filename, QDict *options,
}
qdict_extract_subqdict(options, &file_options, "file.");
+ file_reference = qdict_get_try_str(options, "file");
- ret = bdrv_file_open(&file, filename, NULL, file_options,
+ ret = bdrv_file_open(&file, filename, file_reference, file_options,
bdrv_open_flags(bs, flags | BDRV_O_UNMAP),
&local_err);
+ qdict_del(options, "file");
if (ret < 0) {
goto fail;
}
--
1.8.5.1
- Re: [Qemu-devel] [PATCH v3 04/21] qapi: extend qdict_flatten() for QLists, (continued)
- [Qemu-devel] [PATCH v3 05/21] qemu-option: Add qemu_config_parse_qdict(), Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 06/21] blkdebug: Always call read_config(), Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 07/21] blkdebug: Use command-line in read_config(), Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 08/21] block: Allow reference for bdrv_file_open(), Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 09/21] block: Pass reference to bdrv_file_open(),
Max Reitz <=
- [Qemu-devel] [PATCH v3 10/21] block: Allow block devices without files, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 11/21] block: Allow recursive "file"s, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 12/21] qemu-iotests: Fix output of test 051, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 13/21] blockdev: Move "file" to legacy_opts, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 14/21] blkdebug: Allow command-line file configuration, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 15/21] blkdebug: Make filename optional, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 16/21] blkverify: Allow command-line configuration, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 17/21] blkverify: Don't require protocol filename, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 19/21] qapi: QMP interface for blkdebug and blkverify, Max Reitz, 2013/12/11
- [Qemu-devel] [PATCH v3 18/21] blkdebug: Alias "errno" as "error", Max Reitz, 2013/12/11