From nobody Sat Feb 7 07:10:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1568111217; cv=none; d=zoho.com; s=zohoarc; b=RGTI6N31roOEnaHFSDGlyQ7/0HNz9Qcq4a51AwR77/Sa/NY9AfzlZwFx0BbqPhuVUWuuBnjPeljc6WWkAD2u727PUF/YF51fuIlumVFS87LGMjxHeDgmCTiQPoJhs98Oh/rCqPU4s1+LM+C5IP+dKJItw0vAKTRBUceOTtd3Mw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568111217; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Jk9TmnaWrk/hw+Q9fXNY4alWNkryNPyRTkSKBYX2t5c=; b=hI9g2EAu8Maqe+xl+Ssf6SBpirBKyF/6mqg4xB3sGta+p3UyMkuDJOLbWu0HYXnZLG4ct1NCvnBltMgzyYgaF+4s6FYd1/wPS/vB1+tSKMFSDsRv1eGeN0eVa1U9PGj2qjkwP/kRm/RmHYnMa0YitOWLn+j5Im53FnOlCB9SmsQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568111217584629.8213232515803; Tue, 10 Sep 2019 03:26:57 -0700 (PDT) Received: from localhost ([::1]:37560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7dMM-0002sN-5F for importer@patchew.org; Tue, 10 Sep 2019 06:26:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56597) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7dJK-0000S6-HT for qemu-devel@nongnu.org; Tue, 10 Sep 2019 06:23:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7dJI-0001uP-6X for qemu-devel@nongnu.org; Tue, 10 Sep 2019 06:23:45 -0400 Received: from relay.sw.ru ([185.231.240.75]:60070) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7dJB-0001oJ-Do; Tue, 10 Sep 2019 06:23:38 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1i7dJ7-0007it-2M; Tue, 10 Sep 2019 13:23:33 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Date: Tue, 10 Sep 2019 13:23:21 +0300 Message-Id: <20190910102332.20560-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190910102332.20560-1-vsementsov@virtuozzo.com> References: <20190910102332.20560-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v11 03/14] block/backup: improve comment about image fleecing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, wencongyang2@huawei.com, xiechanglong.d@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, jsnow@redhat.com, stefanha@redhat.com, den@openvz.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/backup.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/block/backup.c b/block/backup.c index 62a747b281..56a4bae61e 100644 --- a/block/backup.c +++ b/block/backup.c @@ -747,9 +747,18 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, job->bitmap_mode =3D bitmap_mode; =20 /* - * Set write flags: - * 1. Detect image-fleecing (and similar) schemes - * 2. Handle compression + * If source is in backing chain of target assume that target is going= to be + * used for "image fleecing", i.e. it should represent a kind of snaps= hot of + * source at backup-start point in time. And target is going to be rea= d by + * somebody (for example, used as NBD export) during backup job. + * + * In this case, we need to add BDRV_REQ_SERIALISING write flag to avo= id + * intersection of backup writes and third party reads from target, + * otherwise reading from target we may occasionally read already upda= ted by + * guest data. + * + * For more information see commit f8d59dfb40bb and test + * tests/qemu-iotests/222 */ job->write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISING : 0) | --=20 2.18.0