From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtjZx-00062d-F0 for qemu-devel@nongnu.org; Thu, 19 Dec 2013 14:48:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtjZY-00054B-Tt for qemu-devel@nongnu.org; Thu, 19 Dec 2013 14:48:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtjZY-000541-Lz for qemu-devel@nongnu.org; Thu, 19 Dec 2013 14:47:52 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBJJlpe2009055 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Dec 2013 14:47:52 -0500 From: Max Reitz Date: Thu, 19 Dec 2013 20:47:16 +0100 Message-Id: <1387482443-10633-16-git-send-email-mreitz@redhat.com> In-Reply-To: <1387482443-10633-1-git-send-email-mreitz@redhat.com> References: <1387482443-10633-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v6 15/22] blkdebug: Allow command-line file configuration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Stefan Hajnoczi , Max Reitz Introduce the "image" option as an alternative to specifying the image through the filename. Signed-off-by: Max Reitz --- block/blkdebug.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c73a6cf..3a46ecd 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_nofail(&runtime_opts); @@ -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