From nobody Thu Nov 6 16:10:11 2025 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.zoho.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 1489417283539623.6160587880573; Mon, 13 Mar 2017 08:01:23 -0700 (PDT) Received: from localhost ([::1]:52524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnRTK-0001TG-5k for importer@patchew.org; Mon, 13 Mar 2017 11:01:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnRNi-0005mZ-Il for qemu-devel@nongnu.org; Mon, 13 Mar 2017 10:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnRNe-0002uz-Lm for qemu-devel@nongnu.org; Mon, 13 Mar 2017 10:55:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35272) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnRNc-0002tH-Fj; Mon, 13 Mar 2017 10:55:24 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D3FA64DAD; Mon, 13 Mar 2017 14:55:24 +0000 (UTC) Received: from noname.redhat.com (ovpn-117-150.ams2.redhat.com [10.36.117.150]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2DEtEUY009408; Mon, 13 Mar 2017 10:55:23 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Mon, 13 Mar 2017 15:55:02 +0100 Message-Id: <1489416908-3771-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1489416908-3771-1-git-send-email-kwolf@redhat.com> References: <1489416908-3771-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Mar 2017 14:55: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 06/12] migration: Document handling of bdrv_is_allocated() errors 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, 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 Migration is the only code left in the tree that does not react to bdrv_is_allocated() failures. But as there is no useful way to react to the failure, and we are merely skipping unallocated sectors on success, just document that our choice of handling is intended. Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- migration/block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/block.c b/migration/block.c index 1941bc2..6741228 100644 --- a/migration/block.c +++ b/migration/block.c @@ -276,6 +276,8 @@ static int mig_save_device_bulk(QEMUFile *f, BlkMigDevS= tate *bmds) if (bmds->shared_base) { qemu_mutex_lock_iothread(); aio_context_acquire(blk_get_aio_context(bb)); + /* Skip unallocated sectors; intentionally treats failure as + * an allocated sector */ while (cur_sector < total_sectors && !bdrv_is_allocated(blk_bs(bb), cur_sector, MAX_IS_ALLOCATED_SEARCH, &nr_sectors)) { --=20 1.8.3.1