[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 26/93] block: Pass reference to bdrv_file_open()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 26/93] block: Pass reference to bdrv_file_open() |
Date: |
Fri, 24 Jan 2014 18:21:09 +0100 |
From: Max Reitz <address@hidden>
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>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 1e53b3d..bef4f82 100644
--- a/block.c
+++ b/block.c
@@ -1056,6 +1056,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;
@@ -1142,9 +1143,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.1.4
- [Qemu-devel] [PULL 16/93] qemu-io: use readline.c, (continued)
- [Qemu-devel] [PULL 16/93] qemu-io: use readline.c, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 17/93] qemu-io: add command completion, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 18/93] blkdebug: Use errp for read_config(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 19/93] blkdebug: Don't require sophisticated filename, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 20/93] qdict: Add qdict_array_split(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 21/93] qapi: extend qdict_flatten() for QLists, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 22/93] qemu-option: Add qemu_config_parse_qdict(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 23/93] blkdebug: Always call read_config(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 24/93] blkdebug: Use command-line in read_config(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 25/93] block: Allow reference for bdrv_file_open(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 26/93] block: Pass reference to bdrv_file_open(),
Kevin Wolf <=
- [Qemu-devel] [PULL 27/93] block: Allow block devices without files, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 29/93] block: Use bdrv_open_image() in bdrv_open(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 30/93] block: Allow recursive "file"s, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 28/93] block: Add bdrv_open_image(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 32/93] blkdebug: Allow command-line file configuration, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 31/93] blockdev: Move "file" to legacy_opts, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 34/93] blkverify: Don't require protocol filename, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 35/93] qapi: Add "errno" to the list of polluted words, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 33/93] blkverify: Allow command-line configuration, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 36/93] qapi: QMP interface for blkdebug and blkverify, Kevin Wolf, 2014/01/24