From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3NdS-0007z4-DA for qemu-devel@nongnu.org; Wed, 15 Jan 2014 05:23:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3NdM-0000td-3q for qemu-devel@nongnu.org; Wed, 15 Jan 2014 05:23:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3NdL-0000tS-Rn for qemu-devel@nongnu.org; Wed, 15 Jan 2014 05:23:40 -0500 From: Kevin Wolf Date: Wed, 15 Jan 2014 11:22:45 +0100 Message-Id: <1389781375-11774-33-git-send-email-kwolf@redhat.com> In-Reply-To: <1389781375-11774-1-git-send-email-kwolf@redhat.com> References: <1389781375-11774-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 32/42] blkdebug: Allow command-line file configuration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz Introduce the "image" option as an alternative to specifying the image through the filename. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- 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