From patchwork Fri Jan 5 06:55:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 855934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCb7S1mCTz9t2Q for ; Fri, 5 Jan 2018 17:56:51 +1100 (AEDT) Received: from localhost ([::1]:50829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLvs-00040b-2s for incoming@patchwork.ozlabs.org; Fri, 05 Jan 2018 01:56:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLv6-0003p3-HI for qemu-devel@nongnu.org; Fri, 05 Jan 2018 01:56:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXLv4-0002PS-AM for qemu-devel@nongnu.org; Fri, 05 Jan 2018 01:56:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39270) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXLuw-0002Fk-RN; Fri, 05 Jan 2018 01:55:51 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9554085545; Fri, 5 Jan 2018 06:55:49 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-115.pek2.redhat.com [10.72.12.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F5E65C881; Fri, 5 Jan 2018 06:55:47 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 14:55:37 +0800 Message-Id: <20180105065538.13375-2-famz@redhat.com> In-Reply-To: <20180105065538.13375-1-famz@redhat.com> References: <20180105065538.13375-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 Jan 2018 06:55:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] qemu-img: Move img_open error reporting to callers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" In the next patch one caller will have a special error handling logic than reporting it, add "Error **" parameters to functions and give control back to callers, to make that possible. Update iotests output accordingly. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake --- qemu-img.c | 115 +++++++++++++++++++++++++++------------------ tests/qemu-iotests/043.out | 6 +-- 2 files changed, 73 insertions(+), 48 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 68b375f998..7d3171c20c 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -268,24 +268,22 @@ static int print_block_option_help(const char *filename, const char *fmt) static BlockBackend *img_open_opts(const char *optstr, QemuOpts *opts, int flags, bool writethrough, - bool quiet, bool force_share) + bool quiet, bool force_share, Error **errp) { QDict *options; - Error *local_err = NULL; BlockBackend *blk; options = qemu_opts_to_qdict(opts, NULL); if (force_share) { if (qdict_haskey(options, BDRV_OPT_FORCE_SHARE) && !qdict_get_bool(options, BDRV_OPT_FORCE_SHARE)) { - error_report("--force-share/-U conflicts with image options"); + error_setg(errp, "--force-share/-U conflicts with image options"); QDECREF(options); return NULL; } qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } - blk = blk_new_open(NULL, NULL, options, flags, &local_err); + blk = blk_new_open(NULL, NULL, options, flags, errp); if (!blk) { - error_reportf_err(local_err, "Could not open '%s': ", optstr); return NULL; } blk_set_enable_write_cache(blk, !writethrough); @@ -297,10 +295,10 @@ static BlockBackend *img_open_file(const char *filename, QDict *options, const char *fmt, int flags, bool writethrough, bool quiet, - bool force_share) + bool force_share, + Error **errp) { BlockBackend *blk; - Error *local_err = NULL; if (!options) { options = qdict_new(); @@ -312,9 +310,8 @@ static BlockBackend *img_open_file(const char *filename, if (force_share) { qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } - blk = blk_new_open(filename, NULL, options, flags, &local_err); + blk = blk_new_open(filename, NULL, options, flags, errp); if (!blk) { - error_reportf_err(local_err, "Could not open '%s': ", filename); return NULL; } blk_set_enable_write_cache(blk, !writethrough); @@ -340,7 +337,8 @@ static BlockBackend *img_open_new_file(const char *filename, QemuOpts *create_opts, const char *fmt, int flags, bool writethrough, bool quiet, - bool force_share) + bool force_share, + Error **errp) { QDict *options = NULL; @@ -348,32 +346,32 @@ static BlockBackend *img_open_new_file(const char *filename, qemu_opt_foreach(create_opts, img_add_key_secrets, options, &error_abort); return img_open_file(filename, options, fmt, flags, writethrough, quiet, - force_share); + force_share, errp); } static BlockBackend *img_open(bool image_opts, const char *filename, const char *fmt, int flags, bool writethrough, - bool quiet, bool force_share) + bool quiet, bool force_share, Error **errp) { BlockBackend *blk; if (image_opts) { QemuOpts *opts; if (fmt) { - error_report("--image-opts and --format are mutually exclusive"); + error_setg(errp, + "--image-opts and --format are mutually exclusive"); return NULL; } - opts = qemu_opts_parse_noisily(qemu_find_opts("source"), - filename, true); + opts = qemu_opts_parse(qemu_find_opts("source"), filename, true, errp); if (!opts) { return NULL; } blk = img_open_opts(filename, opts, flags, writethrough, quiet, - force_share); + force_share, errp); } else { blk = img_open_file(filename, NULL, fmt, flags, writethrough, quiet, - force_share); + force_share, errp); } return blk; } @@ -670,6 +668,7 @@ static int img_check(int argc, char **argv) bool quiet = false; bool image_opts = false; bool force_share = false; + Error *local_err = NULL; fmt = NULL; output = NULL; @@ -769,8 +768,9 @@ static int img_check(int argc, char **argv) } blk = img_open(image_opts, filename, fmt, flags, writethrough, quiet, - force_share); + force_share, &local_err); if (!blk) { + error_reportf_err(local_err, "Could not open '%s': ", filename); return 1; } bs = blk_bs(blk); @@ -979,8 +979,9 @@ static int img_commit(int argc, char **argv) } blk = img_open(image_opts, filename, fmt, flags, writethrough, quiet, - false); + false, &local_err); if (!blk) { + error_reportf_err(local_err, "Could not open '%s': ", filename); return 1; } bs = blk_bs(blk); @@ -1251,6 +1252,7 @@ static int img_compare(int argc, char **argv) uint64_t progress_base; bool image_opts = false; bool force_share = false; + Error *local_err = NULL; cache = BDRV_DEFAULT_CACHE; for (;;) { @@ -1343,15 +1345,17 @@ static int img_compare(int argc, char **argv) } blk1 = img_open(image_opts, filename1, fmt1, flags, writethrough, quiet, - force_share); + force_share, &local_err); if (!blk1) { + error_reportf_err(local_err, "Could not open '%s': ", filename1); ret = 2; goto out3; } blk2 = img_open(image_opts, filename2, fmt2, flags, writethrough, quiet, - force_share); + force_share, &local_err); if (!blk2) { + error_reportf_err(local_err, "Could not open '%s': ", filename2); ret = 2; goto out2; } @@ -2121,8 +2125,10 @@ static int img_convert(int argc, char **argv) for (bs_i = 0; bs_i < s.src_num; bs_i++) { s.src[bs_i] = img_open(image_opts, argv[optind + bs_i], fmt, src_flags, src_writethrough, quiet, - force_share); + force_share, &local_err); if (!s.src[bs_i]) { + error_reportf_err(local_err, "Could not open '%s': ", + argv[optind + bs_i]); ret = -1; goto out; } @@ -2273,7 +2279,7 @@ static int img_convert(int argc, char **argv) if (skip_create) { s.target = img_open(tgt_image_opts, out_filename, out_fmt, - flags, writethrough, quiet, false); + flags, writethrough, quiet, false, &local_err); } else { /* TODO ultimately we should allow --target-image-opts * to be used even when -n is not given. @@ -2281,9 +2287,11 @@ static int img_convert(int argc, char **argv) * to allow filenames in option syntax */ s.target = img_open_new_file(out_filename, opts, out_fmt, - flags, writethrough, quiet, false); + flags, writethrough, quiet, false, + &local_err); } if (!s.target) { + error_reportf_err(local_err, "Could not open '%s': ", out_filename); ret = -1; goto out; } @@ -2439,12 +2447,13 @@ static gboolean str_equal_func(gconstpointer a, gconstpointer b) static ImageInfoList *collect_image_info_list(bool image_opts, const char *filename, const char *fmt, - bool chain, bool force_share) + bool chain, bool force_share, + Error **errp) { ImageInfoList *head = NULL; ImageInfoList **last = &head; GHashTable *filenames; - Error *err = NULL; + Error *local_err = NULL; filenames = g_hash_table_new_full(g_str_hash, str_equal_func, NULL, NULL); @@ -2455,23 +2464,24 @@ static ImageInfoList *collect_image_info_list(bool image_opts, ImageInfoList *elem; if (g_hash_table_lookup_extended(filenames, filename, NULL, NULL)) { - error_report("Backing file '%s' creates an infinite loop.", - filename); + error_setg(errp, + "Backing file '%s' creates an infinite loop.", + filename); goto err; } g_hash_table_insert(filenames, (gpointer)filename, NULL); blk = img_open(image_opts, filename, fmt, BDRV_O_NO_BACKING | BDRV_O_NO_IO, false, false, - force_share); + force_share, errp); if (!blk) { goto err; } bs = blk_bs(blk); - bdrv_query_image_info(bs, &info, &err); - if (err) { - error_report_err(err); + bdrv_query_image_info(bs, &info, &local_err); + if (local_err) { + error_propagate(errp, local_err); blk_unref(blk); goto err; } @@ -2488,9 +2498,10 @@ static ImageInfoList *collect_image_info_list(bool image_opts, if (info->has_full_backing_filename) { filename = info->full_backing_filename; } else if (info->has_backing_filename) { - error_report("Could not determine absolute backing filename," - " but backing filename '%s' present", - info->backing_filename); + error_setg(errp, + "Could not determine absolute backing filename," + " but backing filename '%s' present", + info->backing_filename); goto err; } if (info->has_backing_filename_format) { @@ -2516,6 +2527,7 @@ static int img_info(int argc, char **argv) ImageInfoList *list; bool image_opts = false; bool force_share = false; + Error *local_err = NULL; fmt = NULL; output = NULL; @@ -2592,8 +2604,9 @@ static int img_info(int argc, char **argv) } list = collect_image_info_list(image_opts, filename, fmt, chain, - force_share); + force_share, &local_err); if (!list) { + error_reportf_err(local_err, "Could not open '%s': ", filename); return 1; } @@ -2739,6 +2752,7 @@ static int img_map(int argc, char **argv) int ret = 0; bool image_opts = false; bool force_share = false; + Error *local_err = NULL; fmt = NULL; output = NULL; @@ -2810,8 +2824,10 @@ static int img_map(int argc, char **argv) return 1; } - blk = img_open(image_opts, filename, fmt, 0, false, false, force_share); + blk = img_open(image_opts, filename, fmt, 0, false, false, force_share, + &local_err); if (!blk) { + error_reportf_err(local_err, "Could not open '%s': ", filename); return 1; } bs = blk_bs(blk); @@ -2961,8 +2977,9 @@ static int img_snapshot(int argc, char **argv) /* Open the image */ blk = img_open(image_opts, filename, NULL, bdrv_oflags, false, quiet, - force_share); + force_share, &err); if (!blk) { + error_reportf_err(err, "Could not open '%s': ", filename); return 1; } bs = blk_bs(blk); @@ -3147,8 +3164,9 @@ static int img_rebase(int argc, char **argv) * the reference to a renamed or moved backing file. */ blk = img_open(image_opts, filename, fmt, flags, writethrough, quiet, - false); + false, &local_err); if (!blk) { + error_reportf_err(local_err, "Could not open '%s': ", filename); ret = -1; goto out; } @@ -3507,8 +3525,9 @@ static int img_resize(int argc, char **argv) blk = img_open(image_opts, filename, fmt, BDRV_O_RDWR | BDRV_O_RESIZE, false, quiet, - false); + false, &err); if (!blk) { + error_reportf_err(err, "Could not open '%s': ", filename); ret = -1; goto out; } @@ -3693,8 +3712,9 @@ static int img_amend(int argc, char **argv) } blk = img_open(image_opts, filename, fmt, flags, writethrough, quiet, - false); + false, &err); if (!blk) { + error_reportf_err(err, "Could not open '%s': ", filename); ret = -1; goto out; } @@ -3862,6 +3882,7 @@ static int img_bench(int argc, char **argv) struct timeval t1, t2; int i; bool force_share = false; + Error *local_err = NULL; for (;;) { static const struct option long_options[] = { @@ -4018,8 +4039,9 @@ static int img_bench(int argc, char **argv) } blk = img_open(image_opts, filename, fmt, flags, writethrough, quiet, - force_share); + force_share, &local_err); if (!blk) { + error_reportf_err(local_err, "Could not open '%s': ", filename); ret = -1; goto out; } @@ -4301,9 +4323,10 @@ static int img_dd(int argc, char **argv) } blk1 = img_open(image_opts, in.filename, fmt, 0, false, false, - force_share); + force_share, &local_err); if (!blk1) { + error_reportf_err(local_err, "Could not open '%s': ", in.filename); ret = -1; goto out; } @@ -4374,10 +4397,11 @@ static int img_dd(int argc, char **argv) * support image-opts style. */ blk2 = img_open_file(out.filename, NULL, out_fmt, BDRV_O_RDWR, - false, false, false); + false, false, false, &local_err); if (!blk2) { ret = -1; + error_reportf_err(local_err, "Could not open '%s': ", out.filename); goto out; } @@ -4600,8 +4624,9 @@ static int img_measure(int argc, char **argv) if (filename) { in_blk = img_open(image_opts, filename, fmt, 0, - false, false, force_share); + false, false, force_share, &local_err); if (!in_blk) { + error_reportf_err(local_err, "Could not open '%s': ", filename); goto out; } diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out index b37d2a3807..ee428a4744 100644 --- a/tests/qemu-iotests/043.out +++ b/tests/qemu-iotests/043.out @@ -2,19 +2,19 @@ QA output created by 043 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 == backing file references self == -qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop. +qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base == parent references self == -qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop. +qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.3.base == ancestor references another ancestor == -qemu-img: Backing file 'TEST_DIR/t.IMGFMT.2.base' creates an infinite loop. +qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Backing file 'TEST_DIR/t.IMGFMT.2.base' creates an infinite loop. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base From patchwork Fri Jan 5 06:55:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 855936 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCb9R1Rrjz9s7F for ; Fri, 5 Jan 2018 17:58:35 +1100 (AEDT) Received: from localhost ([::1]:50855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLxZ-0005ej-9u for incoming@patchwork.ozlabs.org; Fri, 05 Jan 2018 01:58:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLv3-0003iM-Ox for qemu-devel@nongnu.org; Fri, 05 Jan 2018 01:55:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXLv2-0002NO-Dd for qemu-devel@nongnu.org; Fri, 05 Jan 2018 01:55:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34723) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXLuz-0002ID-2E; Fri, 05 Jan 2018 01:55:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBC844D221; Fri, 5 Jan 2018 06:55:51 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-115.pek2.redhat.com [10.72.12.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20AE55C881; Fri, 5 Jan 2018 06:55:49 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 14:55:38 +0800 Message-Id: <20180105065538.13375-3-famz@redhat.com> In-Reply-To: <20180105065538.13375-1-famz@redhat.com> References: <20180105065538.13375-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 Jan 2018 06:55:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] qemu-img: info: try -U automatically X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The error message we had didn't have a hint about "-U" when locking the image failed, which is not friendly. Also it is imaginable that the reaction to that error by the user would be a retry with '-U'. So the reason we require "-U" for "qemu-img info" if the image is used is to raise the awareness about what could be wrong. A warning would do just fine, especially since it is a little more informative. The test case reference output is updated accordingly. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake --- qemu-img.c | 14 ++++++++++++++ tests/qemu-iotests/153.out | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7d3171c20c..9684937425 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2605,6 +2605,20 @@ static int img_info(int argc, char **argv) list = collect_image_info_list(image_opts, filename, fmt, chain, force_share, &local_err); + if (!list && !force_share) { + Error *local_err2 = NULL; + list = collect_image_info_list(image_opts, filename, fmt, chain, + true, &local_err2); + if (list) { + error_report("WARNING: --force-share (-U) is not used but it " + "seems the image is attached to a running guest; " + "the information may be inaccurate if it is being " + "updated."); + error_free(local_err); + } else { + error_free(local_err2); + } + } if (!list) { error_reportf_err(local_err, "Could not open '%s': ", filename); return 1; diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out index 5b917b177c..4de35184ba 100644 --- a/tests/qemu-iotests/153.out +++ b/tests/qemu-iotests/153.out @@ -41,8 +41,7 @@ Is another process using the image? no file open, try 'help open' _qemu_img_wrapper info TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" lock -Is another process using the image? +qemu-img: WARNING: --force-share (-U) is not used but it seems the image is attached to a running guest; the information may be inaccurate if it is being updated. _qemu_img_wrapper check TEST_DIR/t.qcow2 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" lock