From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu4oX-00044T-Jx for qemu-devel@nongnu.org; Fri, 20 Dec 2013 13:28:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vu4oR-0001Wf-ID for qemu-devel@nongnu.org; Fri, 20 Dec 2013 13:28:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu4oR-0001WM-3v for qemu-devel@nongnu.org; Fri, 20 Dec 2013 13:28:39 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBKIScvA010051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 20 Dec 2013 13:28:38 -0500 From: Max Reitz Date: Fri, 20 Dec 2013 19:28:15 +0100 Message-Id: <1387564104-15315-16-git-send-email-mreitz@redhat.com> In-Reply-To: <1387564104-15315-1-git-send-email-mreitz@redhat.com> References: <1387564104-15315-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v7 15/24] 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 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.5.1