[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/93] blkdebug: Allow command-line file configuratio
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 32/93] blkdebug: Allow command-line file configuration |
Date: |
Fri, 24 Jan 2014 18:21:15 +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/93] qapi: extend qdict_flatten() for QLists, (continued)
- [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, 2014/01/24
- [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 <=
- [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
- [Qemu-devel] [PULL 37/93] qemu-io: Make filename optional, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 39/93] tests: Add test for qdict_flatten(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 40/93] iotests: Test new blkdebug/blkverify interface, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 38/93] tests: Add test for qdict_array_split(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 41/93] iotests: Test file format nesting, Kevin Wolf, 2014/01/24