[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 33/93] blkverify: Allow command-line configuration
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 33/93] blkverify: Allow command-line configuration |
Date: |
Fri, 24 Jan 2014 18:21:16 +0100 |
From: Max Reitz <address@hidden>
Introduce the "test" and "raw" options for specifying images.
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/blkverify.c | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/block/blkverify.c b/block/blkverify.c
index e15ac4c..dc14290 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -122,7 +122,6 @@ static int blkverify_open(BlockDriverState *bs, QDict
*options, int flags,
BDRVBlkverifyState *s = bs->opaque;
QemuOpts *opts;
Error *local_err = NULL;
- const char *filename, *raw;
int ret;
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
@@ -133,33 +132,19 @@ static int blkverify_open(BlockDriverState *bs, QDict
*options, int flags,
goto fail;
}
- /* Parse the raw image filename */
- raw = qemu_opt_get(opts, "x-raw");
- if (raw == NULL) {
- error_setg(errp, "Could not retrieve raw image filename");
- ret = -EINVAL;
- goto fail;
- }
-
- ret = bdrv_file_open(&bs->file, raw, NULL, NULL, flags, &local_err);
+ /* Open the raw file */
+ ret = bdrv_open_image(&bs->file, qemu_opt_get(opts, "x-raw"), options,
+ "raw", flags, true, false, &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
goto fail;
}
/* Open the test file */
- filename = qemu_opt_get(opts, "x-image");
- if (filename == NULL) {
- error_setg(errp, "Could not retrieve test image filename");
- ret = -EINVAL;
- goto fail;
- }
-
- s->test_file = bdrv_new("");
- ret = bdrv_open(s->test_file, filename, NULL, flags, NULL, &local_err);
+ ret = bdrv_open_image(&s->test_file, qemu_opt_get(opts, "x-image"),
options,
+ "test", flags, false, false, &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
- bdrv_unref(s->test_file);
s->test_file = NULL;
goto fail;
}
--
1.8.1.4
- [Qemu-devel] [PULL 25/93] block: Allow reference for bdrv_file_open(), (continued)
- [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, 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 <=
- [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
- [Qemu-devel] [PULL 42/93] block: fix backing file segfault, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 43/93] dataplane: fix shadowed return value, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 44/93] qcow2: fix wrong value of L1E_OFFSET_MASK, L2E_OFFSET_MASK and REFT_OFFSET_MASK, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 45/93] vmdk: Check for overhead when opening, Kevin Wolf, 2014/01/24