From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277322580864.8571394883745; Tue, 21 Nov 2017 07:15:22 -0800 (PST) Received: from localhost ([::1]:35019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAGK-0007bs-Qa for importer@patchew.org; Tue, 21 Nov 2017 10:15:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHABz-00033z-TQ for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHABy-0005AX-Sh for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48310) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHABt-00057C-6K; Tue, 21 Nov 2017 10:10:25 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5868DC053FD5; Tue, 21 Nov 2017 15:10:24 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1924F6C427; Tue, 21 Nov 2017 15:10:22 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:11 +0100 Message-Id: <20171121151017.28158-2-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Nov 2017 15:10:24 +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] [PULL 1/7] block: Don't use BLK_PERM_CONSISTENT_READ for format probing 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For format probing, we don't really care whether all of the image content is consistent. The only thing we're looking at is the image header, and specifically the magic numbers that are expected to never change, no matter how inconsistent the guest visible disk content is. Therefore, don't request BLK_PERM_CONSISTENT_READ. This allows to use format probing, e.g. in the context of 'qemu-img info', even while the guest visible data in the image is inconsistent during a running block job. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- block.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 6c8ef98dfa..68b724206d 100644 --- a/block.c +++ b/block.c @@ -2579,7 +2579,10 @@ static BlockDriverState *bdrv_open_inherit(const cha= r *filename, goto fail; } if (file_bs !=3D NULL) { - file =3D blk_new(BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL); + /* Not requesting BLK_PERM_CONSISTENT_READ because we're only + * looking at the header to guess the image format. This works= even + * in cases where a guest would not see a consistent state. */ + file =3D blk_new(0, BLK_PERM_ALL); blk_insert_bs(file, file_bs, &local_err); bdrv_unref(file_bs); if (local_err) { --=20 2.13.6 From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277163581792.8910475857119; Tue, 21 Nov 2017 07:12:43 -0800 (PST) Received: from localhost ([::1]:35001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHADw-0004RN-H2 for importer@patchew.org; Tue, 21 Nov 2017 10:12:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAC6-00039z-Tt for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHAC1-0005CD-7f for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21500) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHABv-00057y-2j; Tue, 21 Nov 2017 10:10:27 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51464C04575B; Tue, 21 Nov 2017 15:10:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id A00197FAA0; Tue, 21 Nov 2017 15:10:24 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:12 +0100 Message-Id: <20171121151017.28158-3-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Nov 2017 15:10:26 +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] [PULL 2/7] block: Don't request I/O permission with BDRV_O_NO_IO 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 'qemu-img info' makes sense even when BLK_PERM_CONSISTENT_READ cannot be granted because of a block job in a running qemu process. It already sets BDRV_O_NO_IO to indicate that it doesn't access the guest visible data at all. Check the BDRV_O_NO_IO flags in blk_new_open(), so that I/O related permissions are not unnecessarily requested and 'qemu-img info' can work even if BLK_PERM_CONSISTENT_READ cannot be granted. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng Reviewed-by: Alberto Garcia --- block/block-backend.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 5836cb3087..baef8e7abc 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -299,7 +299,7 @@ BlockBackend *blk_new_open(const char *filename, const = char *reference, { BlockBackend *blk; BlockDriverState *bs; - uint64_t perm; + uint64_t perm =3D 0; =20 /* blk_new_open() is mainly used in .bdrv_create implementations and t= he * tools where sharing isn't a concern because the BDS stays private, = so we @@ -309,9 +309,11 @@ BlockBackend *blk_new_open(const char *filename, const= char *reference, * caller of blk_new_open() doesn't make use of the permissions, but t= hey * shouldn't hurt either. We can still share everything here because t= he * guest devices will add their own blockers if they can't share. */ - perm =3D BLK_PERM_CONSISTENT_READ; - if (flags & BDRV_O_RDWR) { - perm |=3D BLK_PERM_WRITE; + if ((flags & BDRV_O_NO_IO) =3D=3D 0) { + perm |=3D BLK_PERM_CONSISTENT_READ; + if (flags & BDRV_O_RDWR) { + perm |=3D BLK_PERM_WRITE; + } } if (flags & BDRV_O_RESIZE) { perm |=3D BLK_PERM_RESIZE; --=20 2.13.6 From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277420671407.0672586374553; Tue, 21 Nov 2017 07:17:00 -0800 (PST) Received: from localhost ([::1]:35039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAI6-0000rv-Rm for importer@patchew.org; Tue, 21 Nov 2017 10:16:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAC9-0003CJ-9r for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHAC3-0005Dy-8G for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHABx-00058o-6m; Tue, 21 Nov 2017 10:10:29 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76CB7C059752; Tue, 21 Nov 2017 15:10:28 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id A11E77A1E6; Tue, 21 Nov 2017 15:10:26 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:13 +0100 Message-Id: <20171121151017.28158-4-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Nov 2017 15:10:28 +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] [PULL 3/7] block: Add errp to bdrv_snapshot_goto() 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- include/block/snapshot.h | 3 ++- block/snapshot.c | 23 +++++++++++++++++------ qemu-img.c | 6 +++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/include/block/snapshot.h b/include/block/snapshot.h index e5c0553115..aeb80405e8 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -57,7 +57,8 @@ int bdrv_can_snapshot(BlockDriverState *bs); int bdrv_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info); int bdrv_snapshot_goto(BlockDriverState *bs, - const char *snapshot_id); + const char *snapshot_id, + Error **errp); int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id, const char *name, diff --git a/block/snapshot.c b/block/snapshot.c index be0743abac..75562df4cc 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -177,18 +177,21 @@ int bdrv_snapshot_create(BlockDriverState *bs, } =20 int bdrv_snapshot_goto(BlockDriverState *bs, - const char *snapshot_id) + const char *snapshot_id, + Error **errp) { BlockDriver *drv =3D bs->drv; int ret, open_ret; int64_t len; =20 if (!drv) { + error_setg(errp, "Block driver is closed"); return -ENOMEDIUM; } =20 len =3D bdrv_getlength(bs); if (len < 0) { + error_setg_errno(errp, -len, "Cannot get block device size"); return len; } /* We should set all bits in all enabled dirty bitmaps, because dirty @@ -200,13 +203,18 @@ int bdrv_snapshot_goto(BlockDriverState *bs, bdrv_set_dirty(bs, 0, len); =20 if (drv->bdrv_snapshot_goto) { - return drv->bdrv_snapshot_goto(bs, snapshot_id); + ret =3D drv->bdrv_snapshot_goto(bs, snapshot_id); + if (ret < 0) { + error_setg_errno(errp, -ret, "Failed to load snapshot"); + } + return ret; } =20 if (bs->file) { BlockDriverState *file; QDict *options =3D qdict_clone_shallow(bs->options); QDict *file_options; + Error *local_err =3D NULL; =20 file =3D bs->file->bs; /* Prevent it from getting deleted when detached from bs */ @@ -220,13 +228,15 @@ int bdrv_snapshot_goto(BlockDriverState *bs, bdrv_unref_child(bs, bs->file); bs->file =3D NULL; =20 - ret =3D bdrv_snapshot_goto(file, snapshot_id); - open_ret =3D drv->bdrv_open(bs, options, bs->open_flags, NULL); + ret =3D bdrv_snapshot_goto(file, snapshot_id, errp); + open_ret =3D drv->bdrv_open(bs, options, bs->open_flags, &local_er= r); QDECREF(options); if (open_ret < 0) { bdrv_unref(file); bs->drv =3D NULL; - return open_ret; + /* A bdrv_snapshot_goto() error takes precedence */ + error_propagate(errp, local_err); + return ret < 0 ? ret : open_ret; } =20 assert(bs->file->bs =3D=3D file); @@ -234,6 +244,7 @@ int bdrv_snapshot_goto(BlockDriverState *bs, return ret; } =20 + error_setg(errp, "Block driver does not support snapshots"); return -ENOTSUP; } =20 @@ -467,7 +478,7 @@ int bdrv_all_goto_snapshot(const char *name, BlockDrive= rState **first_bad_bs) =20 aio_context_acquire(ctx); if (bdrv_can_snapshot(bs)) { - err =3D bdrv_snapshot_goto(bs, name); + err =3D bdrv_snapshot_goto(bs, name, NULL); } aio_context_release(ctx); if (err < 0) { diff --git a/qemu-img.c b/qemu-img.c index 02a6e27beb..68b375f998 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2989,10 +2989,10 @@ static int img_snapshot(int argc, char **argv) break; =20 case SNAPSHOT_APPLY: - ret =3D bdrv_snapshot_goto(bs, snapshot_name); + ret =3D bdrv_snapshot_goto(bs, snapshot_name, &err); if (ret) { - error_report("Could not apply snapshot '%s': %d (%s)", - snapshot_name, ret, strerror(-ret)); + error_reportf_err(err, "Could not apply snapshot '%s': ", + snapshot_name); } break; =20 --=20 2.13.6 From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277168446977.2479833503752; Tue, 21 Nov 2017 07:12:48 -0800 (PST) Received: from localhost ([::1]:35002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHADz-0004Zy-GU for importer@patchew.org; Tue, 21 Nov 2017 10:12:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAC8-0003BM-EJ for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHAC7-0005HZ-FH for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44150) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHABz-0005Al-Gg; Tue, 21 Nov 2017 10:10:31 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADF77D56ED; Tue, 21 Nov 2017 15:10:30 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id C48AB6C427; Tue, 21 Nov 2017 15:10:28 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:14 +0100 Message-Id: <20171121151017.28158-5-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 21 Nov 2017 15:10:30 +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] [PULL 4/7] block: Add errp to bdrv_all_goto_snapshot() 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- include/block/snapshot.h | 3 ++- block/snapshot.c | 11 ++++++----- migration/savevm.c | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/block/snapshot.h b/include/block/snapshot.h index aeb80405e8..9407799941 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -84,7 +84,8 @@ int bdrv_snapshot_load_tmp_by_id_or_name(BlockDriverState= *bs, bool bdrv_all_can_snapshot(BlockDriverState **first_bad_bs); int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bs= d_bs, Error **err); -int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bsd_= bs); +int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_= bs, + Error **errp); int bdrv_all_find_snapshot(const char *name, BlockDriverState **first_bad_= bs); int bdrv_all_create_snapshot(QEMUSnapshotInfo *sn, BlockDriverState *vm_state_bs, diff --git a/block/snapshot.c b/block/snapshot.c index 75562df4cc..8585599579 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -467,9 +467,10 @@ fail: } =20 =20 -int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_= bs) +int bdrv_all_goto_snapshot(const char *name, BlockDriverState **first_bad_= bs, + Error **errp) { - int err =3D 0; + int ret =3D 0; BlockDriverState *bs; BdrvNextIterator it; =20 @@ -478,10 +479,10 @@ int bdrv_all_goto_snapshot(const char *name, BlockDri= verState **first_bad_bs) =20 aio_context_acquire(ctx); if (bdrv_can_snapshot(bs)) { - err =3D bdrv_snapshot_goto(bs, name, NULL); + ret =3D bdrv_snapshot_goto(bs, name, errp); } aio_context_release(ctx); - if (err < 0) { + if (ret < 0) { bdrv_next_cleanup(&it); goto fail; } @@ -489,7 +490,7 @@ int bdrv_all_goto_snapshot(const char *name, BlockDrive= rState **first_bad_bs) =20 fail: *first_bad_bs =3D bs; - return err; + return ret; } =20 int bdrv_all_find_snapshot(const char *name, BlockDriverState **first_bad_= bs) diff --git a/migration/savevm.c b/migration/savevm.c index 4a88228614..192f2d82cd 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2346,10 +2346,10 @@ int load_snapshot(const char *name, Error **errp) /* Flush all IO requests so they don't interfere with the new state. = */ bdrv_drain_all_begin(); =20 - ret =3D bdrv_all_goto_snapshot(name, &bs); + ret =3D bdrv_all_goto_snapshot(name, &bs, errp); if (ret < 0) { - error_setg(errp, "Error %d while activating snapshot '%s' on '%s'", - ret, name, bdrv_get_device_name(bs)); + error_prepend(errp, "Could not load snapshot '%s' on '%s': ", + name, bdrv_get_device_name(bs)); goto err_drain; } =20 --=20 2.13.6 From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277327179183.71085761189727; Tue, 21 Nov 2017 07:15:27 -0800 (PST) Received: from localhost ([::1]:35021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAGg-0007ty-CF for importer@patchew.org; Tue, 21 Nov 2017 10:15:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHACC-0003Ev-05 for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHAC7-0005HQ-7q for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51230) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHAC1-0005CA-PU; Tue, 21 Nov 2017 10:10:33 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04CD7356C4; Tue, 21 Nov 2017 15:10:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 080DC7FAA3; Tue, 21 Nov 2017 15:10:30 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:15 +0100 Message-Id: <20171121151017.28158-6-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 21 Nov 2017 15:10:33 +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] [PULL 5/7] block: Error out on load_vm with active dirty bitmaps 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Loading a snapshot invalidates the bitmap. Just marking all blocks dirty is not a useful response in practice, instead the user needs to be aware that we switch to a completely different state. If they are okay with losing the dirty bitmap, they can just explicitly delete it. This effectively reverts commit 04dec3c3ae5. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- block/snapshot.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/block/snapshot.c b/block/snapshot.c index 8585599579..8cb70dbad5 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -182,25 +182,16 @@ int bdrv_snapshot_goto(BlockDriverState *bs, { BlockDriver *drv =3D bs->drv; int ret, open_ret; - int64_t len; =20 if (!drv) { error_setg(errp, "Block driver is closed"); return -ENOMEDIUM; } =20 - len =3D bdrv_getlength(bs); - if (len < 0) { - error_setg_errno(errp, -len, "Cannot get block device size"); - return len; + if (!QLIST_EMPTY(&bs->dirty_bitmaps)) { + error_setg(errp, "Device has active dirty bitmaps"); + return -EBUSY; } - /* We should set all bits in all enabled dirty bitmaps, because dirty - * bitmaps reflect active state of disk and snapshot switch operation - * actually dirties active state. - * TODO: It may make sense not to set all bits but analyze block statu= s of - * current state and destination snapshot and do not set bits correspo= nding - * to both-zero or both-unallocated areas. */ - bdrv_set_dirty(bs, 0, len); =20 if (drv->bdrv_snapshot_goto) { ret =3D drv->bdrv_snapshot_goto(bs, snapshot_id); --=20 2.13.6 From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277173233414.5765198867957; Tue, 21 Nov 2017 07:12:53 -0800 (PST) Received: from localhost ([::1]:35003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAEB-0005BA-8W for importer@patchew.org; Tue, 21 Nov 2017 10:12:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAC9-0003C3-0i for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHAC7-0005He-MT for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHAC3-0005E3-Qn; Tue, 21 Nov 2017 10:10:36 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 153124DB12; Tue, 21 Nov 2017 15:10:35 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 232BB7FAA1; Tue, 21 Nov 2017 15:10:32 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:16 +0100 Message-Id: <20171121151017.28158-7-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 21 Nov 2017 15:10:35 +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] [PULL 6/7] block: Close a BlockDriverState completely even when bs->drv is NULL 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia bdrv_close() skips much of its logic when bs->drv is NULL. This is fine when we're closing a BlockDriverState that has just been created (because e.g the initialization process failed), but it's not enough in other cases. For example, when a valid qcow2 image is found to be corrupted then QEMU marks it as such in the file header and then sets bs->drv to NULL in order to make the BlockDriverState unusable. When that BDS is later closed then many of its data structures are not freed (leaking their memory) and none of its children are detached. This results in bdrv_close_all() failing to close all BDSs and making this assertion fail when QEMU is being shut down: bdrv_close_all: Assertion `QTAILQ_EMPTY(&all_bdrv_states)' failed. This patch makes bdrv_close() do the full uninitialization process in all cases. This fixes the problem with corrupted images and still works fine with freshly created BDSs. Signed-off-by: Alberto Garcia Message-id: 20171106145345.12038-1-berto@igalia.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block.c | 57 +++++++++++++++++++++++-------------------= ---- tests/qemu-iotests/060 | 13 +++++++++++ tests/qemu-iotests/060.out | 12 ++++++++++ 3 files changed, 53 insertions(+), 29 deletions(-) diff --git a/block.c b/block.c index 68b724206d..9a1a0d1e73 100644 --- a/block.c +++ b/block.c @@ -3198,6 +3198,7 @@ void bdrv_reopen_abort(BDRVReopenState *reopen_state) static void bdrv_close(BlockDriverState *bs) { BdrvAioNotifier *ban, *ban_next; + BdrvChild *child, *next; =20 assert(!bs->job); assert(!bs->refcnt); @@ -3207,43 +3208,41 @@ static void bdrv_close(BlockDriverState *bs) bdrv_drain(bs); /* in case flush left pending I/O */ =20 if (bs->drv) { - BdrvChild *child, *next; - bs->drv->bdrv_close(bs); bs->drv =3D NULL; + } =20 - bdrv_set_backing_hd(bs, NULL, &error_abort); + bdrv_set_backing_hd(bs, NULL, &error_abort); =20 - if (bs->file !=3D NULL) { - bdrv_unref_child(bs, bs->file); - bs->file =3D NULL; - } + if (bs->file !=3D NULL) { + bdrv_unref_child(bs, bs->file); + bs->file =3D NULL; + } =20 - QLIST_FOREACH_SAFE(child, &bs->children, next, next) { - /* TODO Remove bdrv_unref() from drivers' close function and u= se - * bdrv_unref_child() here */ - if (child->bs->inherits_from =3D=3D bs) { - child->bs->inherits_from =3D NULL; - } - bdrv_detach_child(child); + QLIST_FOREACH_SAFE(child, &bs->children, next, next) { + /* TODO Remove bdrv_unref() from drivers' close function and use + * bdrv_unref_child() here */ + if (child->bs->inherits_from =3D=3D bs) { + child->bs->inherits_from =3D NULL; } - - g_free(bs->opaque); - bs->opaque =3D NULL; - atomic_set(&bs->copy_on_read, 0); - bs->backing_file[0] =3D '\0'; - bs->backing_format[0] =3D '\0'; - bs->total_sectors =3D 0; - bs->encrypted =3D false; - bs->sg =3D false; - QDECREF(bs->options); - QDECREF(bs->explicit_options); - bs->options =3D NULL; - bs->explicit_options =3D NULL; - QDECREF(bs->full_open_options); - bs->full_open_options =3D NULL; + bdrv_detach_child(child); } =20 + g_free(bs->opaque); + bs->opaque =3D NULL; + atomic_set(&bs->copy_on_read, 0); + bs->backing_file[0] =3D '\0'; + bs->backing_format[0] =3D '\0'; + bs->total_sectors =3D 0; + bs->encrypted =3D false; + bs->sg =3D false; + QDECREF(bs->options); + QDECREF(bs->explicit_options); + bs->options =3D NULL; + bs->explicit_options =3D NULL; + QDECREF(bs->full_open_options); + bs->full_open_options =3D NULL; + bdrv_release_named_dirty_bitmaps(bs); assert(QLIST_EMPTY(&bs->dirty_bitmaps)); =20 diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index 1eca09417b..14797dd3b0 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -426,6 +426,19 @@ echo '--- Repairing ---' _check_test_img -q -r all _check_test_img -r all =20 +echo +echo "=3D=3D=3D Testing the QEMU shutdown with a corrupted image =3D=3D=3D" +echo +_make_test_img 64M +poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\x00\x00\x00\x0= 0" +echo "{'execute': 'qmp_capabilities'} + {'execute': 'human-monitor-command', + 'arguments': {'command-line': 'qemu-io drive \"write 0 512\"'}} + {'execute': 'quit'}" \ + | $QEMU -qmp stdio -nographic -nodefaults \ + -drive if=3Dnone,node-name=3Ddrive,file=3D"$TEST_IMG",driver= =3Dqcow2 \ + | _filter_qmp | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index 56f5eb15d8..c4cb7c665e 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -399,4 +399,16 @@ The following inconsistencies were found and repaired: =20 Double checking the fixed image now... No errors were found on the image. + +=3D=3D=3D Testing the QEMU shutdown with a corrupted image =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +qcow2: Marking image as corrupt: Preventing invalid write on metadata (ove= rlaps with refcount table); further corruption events will be suppressed +QMP_VERSION +{"return": {}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_IMAGE_CORRUPTED", "data": {"device": "none0", "msg": "Preventing i= nvalid write on metadata (overlaps with refcount table)", "offset": 65536, = "node-name": "drive", "fatal": true, "size": 65536}} +write failed: Input/output error +{"return": ""} +{"return": {}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done --=20 2.13.6 From nobody Sat May 4 20:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511277493773223.66878791697604; Tue, 21 Nov 2017 07:18:13 -0800 (PST) Received: from localhost ([::1]:35050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHAJE-0001UL-Mx for importer@patchew.org; Tue, 21 Nov 2017 10:18:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHACG-0003Ia-2S for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHACF-0005Ka-0X for qemu-devel@nongnu.org; Tue, 21 Nov 2017 10:10:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHAC6-0005Fn-8r; Tue, 21 Nov 2017 10:10:38 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F40A66C7F; Tue, 21 Nov 2017 15:10:37 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 495187FAA1; Tue, 21 Nov 2017 15:10:35 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 21 Nov 2017 16:10:17 +0100 Message-Id: <20171121151017.28158-8-kwolf@redhat.com> In-Reply-To: <20171121151017.28158-1-kwolf@redhat.com> References: <20171121151017.28158-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 21 Nov 2017 15:10:37 +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] [PULL 7/7] iotests: Fix 176 on 32-bit host 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake The contents of a qcow2 bitmap are rounded up to a size that matches the number of bits available for the granularity, but that granularity differs for 32-bit hosts (our default 64k cluster allows for 2M bitmap coverage per 'long') and 64-bit hosts (4M bitmap per 'long'). If the image is a multiple of 2M but not 4M, then the number of bytes occupied by the array of longs in memory differs between architecture, thus resulting in different SHA256 hashes. Furthermore (but untested by me), if our computation of the SHA256 hash is at all endian-dependent because of how we store data in memory, that's another variable we'd have to account for (ideally, we specified the bitmap stored in qcow2 as fixed-endian on disk, because the same qcow2 file must be usable across any architecture; but that says nothing about how we represent things in memory). But we already have test 165 to validate that bitmaps are stored correctly on disk, while this test is merely testing that the bitmap exists. So for this test, the easiest solution is to filter out the actual hash value. Broken in commit 4096974e. Reported-by: Max Reitz Signed-off-by: Eric Blake Message-id: 20171117190422.23626-1-eblake@redhat.com Reviewed-by: John Snow Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- tests/qemu-iotests/176 | 3 ++- tests/qemu-iotests/176.out | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176 index 0f31a20294..b8dc17c592 100755 --- a/tests/qemu-iotests/176 +++ b/tests/qemu-iotests/176 @@ -52,7 +52,8 @@ _supported_os Linux function run_qemu() { $QEMU -nographic -qmp stdio -serial none "$@" 2>&1 \ - | _filter_testdir | _filter_qmp | _filter_qemu + | _filter_testdir | _filter_qmp | _filter_qemu \ + | sed 's/"sha256": ".\{64\}"/"sha256": HASH/' } =20 for reason in snapshot bitmap; do diff --git a/tests/qemu-iotests/176.out b/tests/qemu-iotests/176.out index e62085cd0a..f03a2e776c 100644 --- a/tests/qemu-iotests/176.out +++ b/tests/qemu-iotests/176.out @@ -205,7 +205,7 @@ Offset Length File QMP_VERSION {"return": {}} {"return": {}} -{"return": {"sha256": "e12600978d86b5a453861ae5c17d275204673fef3874b7c3c54= 33c6153d84706"}} +{"return": {"sha256": HASH}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 @@ -255,7 +255,7 @@ Offset Length File QMP_VERSION {"return": {}} {"return": {}} -{"return": {"sha256": "e12600978d86b5a453861ae5c17d275204673fef3874b7c3c54= 33c6153d84706"}} +{"return": {"sha256": HASH}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 @@ -305,7 +305,7 @@ Offset Length File QMP_VERSION {"return": {}} {"return": {}} -{"return": {"sha256": "e12600978d86b5a453861ae5c17d275204673fef3874b7c3c54= 33c6153d84706"}} +{"return": {"sha256": HASH}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 @@ -352,7 +352,7 @@ Offset Length File QMP_VERSION {"return": {}} {"return": {}} -{"return": {"sha256": "e12600978d86b5a453861ae5c17d275204673fef3874b7c3c54= 33c6153d84706"}} +{"return": {"sha256": HASH}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done --=20 2.13.6