[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/42] blkdebug: Allow command-line file configuratio
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 32/42] blkdebug: Allow command-line file configuration |
Date: |
Wed, 15 Jan 2014 11:22:45 +0100 |
From: Max Reitz <address@hidden>
Introduce the "image" option as an alternative to specifying the image
through the filename.
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <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.1.4
- [Qemu-devel] [PULL 21/42] qapi: extend qdict_flatten() for QLists, (continued)
- [Qemu-devel] [PULL 21/42] qapi: extend qdict_flatten() for QLists, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 19/42] blkdebug: Don't require sophisticated filename, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 22/42] qemu-option: Add qemu_config_parse_qdict(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 24/42] blkdebug: Use command-line in read_config(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 23/42] blkdebug: Always call read_config(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 26/42] block: Pass reference to bdrv_file_open(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 25/42] block: Allow reference for bdrv_file_open(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 28/42] block: Add bdrv_open_image(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 29/42] block: Use bdrv_open_image() in bdrv_open(), Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 31/42] blockdev: Move "file" to legacy_opts, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 32/42] blkdebug: Allow command-line file configuration,
Kevin Wolf <=
- [Qemu-devel] [PULL 30/42] block: Allow recursive "file"s, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 33/42] blkverify: Allow command-line configuration, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 35/42] qapi: Add "errno" to the list of polluted words, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 34/42] blkverify: Don't require protocol filename, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 36/42] qapi: QMP interface for blkdebug and blkverify, Kevin Wolf, 2014/01/15
- [Qemu-devel] [PULL 37/42] qemu-io: Make filename optional, Kevin Wolf, 2014/01/15