[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 15/22] blkdebug: Allow command-line file configur
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v6 15/22] blkdebug: Allow command-line file configuration |
Date: |
Thu, 19 Dec 2013 20:47:16 +0100 |
Introduce the "image" option as an alternative to specifying the image
through the filename.
Signed-off-by: Max Reitz <address@hidden>
---
block/blkdebug.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/block/blkdebug.c b/block/blkdebug.c
index c73a6cf..3a46ecd 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -374,7 +374,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict
*options, int flags,
BDRVBlkdebugState *s = bs->opaque;
QemuOpts *opts;
Error *local_err = NULL;
- const char *filename, *config;
+ const char *config;
int ret;
opts = qemu_opts_create_nofail(&runtime_opts);
@@ -396,14 +396,8 @@ static int blkdebug_open(BlockDriverState *bs, QDict
*options, int flags,
s->state = 1;
/* Open the backing file */
- filename = qemu_opt_get(opts, "x-image");
- if (filename == NULL) {
- error_setg(errp, "Could not retrieve image file name");
- ret = -EINVAL;
- goto fail;
- }
-
- ret = bdrv_file_open(&bs->file, filename, NULL, NULL, flags, &local_err);
+ ret = bdrv_open_image(&bs->file, qemu_opt_get(opts, "x-image"), options,
"image",
+ flags, true, false, &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
goto fail;
--
1.8.5.1
- [Qemu-devel] [PATCH v6 05/22] qemu-option: Add qemu_config_parse_qdict(), (continued)
- [Qemu-devel] [PATCH v6 05/22] qemu-option: Add qemu_config_parse_qdict(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 06/22] blkdebug: Always call read_config(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 07/22] blkdebug: Use command-line in read_config(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 08/22] block: Allow reference for bdrv_file_open(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 09/22] block: Pass reference to bdrv_file_open(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 10/22] block: Allow block devices without files, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 11/22] block: Add bdrv_open_image(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 12/22] block: Use bdrv_open_image() in bdrv_open(), Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 13/22] block: Allow recursive "file"s, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 14/22] blockdev: Move "file" to legacy_opts, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 15/22] blkdebug: Allow command-line file configuration,
Max Reitz <=
- [Qemu-devel] [PATCH v6 16/22] blkverify: Allow command-line configuration, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 18/22] qapi: Add "errno" to the list of polluted words, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 17/22] blkverify: Don't require protocol filename, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 19/22] qapi: QMP interface for blkdebug and blkverify, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 20/22] qemu-io: Make filename optional, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 21/22] iotests: Test new blkdebug/blkverify interface, Max Reitz, 2013/12/19
- [Qemu-devel] [PATCH v6 22/22] iotests: Test file format nesting, Max Reitz, 2013/12/19