[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 15/24] blkdebug: Allow command-line file configur
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v7 15/24] blkdebug: Allow command-line file configuration |
Date: |
Fri, 20 Dec 2013 19:28:15 +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 21a4931..c8f8d56 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(&runtime_opts, NULL, 0, &error_abort);
@@ -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
- Re: [Qemu-devel] [PATCH v7 04/24] qapi: extend qdict_flatten() for QLists, (continued)
- [Qemu-devel] [PATCH v7 05/24] qemu-option: Add qemu_config_parse_qdict(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 06/24] blkdebug: Always call read_config(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 07/24] blkdebug: Use command-line in read_config(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 08/24] block: Allow reference for bdrv_file_open(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 09/24] block: Pass reference to bdrv_file_open(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 10/24] block: Allow block devices without files, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 11/24] block: Add bdrv_open_image(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 12/24] block: Use bdrv_open_image() in bdrv_open(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 13/24] block: Allow recursive "file"s, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 15/24] blkdebug: Allow command-line file configuration,
Max Reitz <=
- [Qemu-devel] [PATCH v7 14/24] blockdev: Move "file" to legacy_opts, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 16/24] blkverify: Allow command-line configuration, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 17/24] blkverify: Don't require protocol filename, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 18/24] qapi: Add "errno" to the list of polluted words, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 19/24] qapi: QMP interface for blkdebug and blkverify, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 20/24] qemu-io: Make filename optional, Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 21/24] tests: Add test for qdict_array_split(), Max Reitz, 2013/12/20
- [Qemu-devel] [PATCH v7 22/24] tests: Add test for qdict_flatten(), Max Reitz, 2013/12/20