From patchwork Sun Jul 18 14:48:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 12384375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6E84C636C8 for ; Sun, 18 Jul 2021 14:51:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4937761183 for ; Sun, 18 Jul 2021 14:51:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4937761183 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m588Y-0001LB-Et for qemu-devel@archiver.kernel.org; Sun, 18 Jul 2021 10:51:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m586H-0005gk-Tg; Sun, 18 Jul 2021 10:49:03 -0400 Received: from mout.web.de ([212.227.15.4]:51017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m586G-0006mI-8P; Sun, 18 Jul 2021 10:49:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1626619723; bh=Xdx3AT1ta8Wzmt0uIMYWRw/wFZ/Bqr7Zn6wzhDeMz9o=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=hp+6xkmUvLvuKCZsXXapS1/QBQb9l9HcJa90V2AKtElK8FHaKMRKw/P9dKCxIJQ6k iPzrcaELGGE5lQSqLqQbZIwAKt9MiwS2CzSXM2YyZqqhmqktKnUms3HnRYUdH0vGwG DTrd6KYRxRNZF1oc5R37FVSO2ETOfyRxbB2JDWrU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([89.247.255.49]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MA4fW-1lz2ED0YVW-00Bwda; Sun, 18 Jul 2021 16:48:43 +0200 Date: Sun, 18 Jul 2021 16:48:42 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v6 4/4] replication: Remove workaround Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:Yhxfm+ArU7RCDaVik9FSrL60zGp7Iqkc4RWho90BBULkAIbYFQk DPF70S9Uu158e2EC7bN62fjQ+vZnS5qNchZapMzbLwyJTvYw/j0JdWcwQ+ECv5WrbbceoXX m0Czjt2mFtVcAnv7z60BvxiClNO/Aqe4EAApbAmHjX21t+yRdEKL2irzkNsi6g6QL5GBTgq 5NnP3uSFUGYcYOaHbKeXA== X-UI-Out-Filterresults: notjunk:1;V03:K0:t/VMsmKmKrA=:hCqMZyeRkmkI6bJmbfRAHd zFXYqO6mLLEhK/6di51a26KG/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 z2OKM0EXzXJP1xrBeksPdYrs/l/O/lUFeeo Received-SPF: pass client-ip=212.227.15.4; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-block , Wen Congyang , Xie Changlong , Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Remove the workaround introduced in commit 6ecbc6c52672db5c13805735ca02784879ce8285 "replication: Avoid blk_make_empty() on read-only child". It is not needed anymore since s->hidden_disk is guaranteed to be writable when secondary_do_checkpoint() runs. Because replication_start(), _do_checkpoint() and _stop() are only called by COLO migration code and COLO-migration activates all disks via bdrv_invalidate_cache_all() before it calls these functions. Signed-off-by: Lukas Straub Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/replication.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) -- 2.20.1 diff --git a/block/replication.c b/block/replication.c index b74192f795..32444b9a8f 100644 --- a/block/replication.c +++ b/block/replication.c @@ -346,17 +346,7 @@ static void secondary_do_checkpoint(BlockDriverState *bs, Error **errp) return; } - BlockBackend *blk = blk_new(qemu_get_current_aio_context(), - BLK_PERM_WRITE, BLK_PERM_ALL); - blk_insert_bs(blk, s->hidden_disk->bs, &local_err); - if (local_err) { - error_propagate(errp, local_err); - blk_unref(blk); - return; - } - - ret = blk_make_empty(blk, errp); - blk_unref(blk); + ret = bdrv_make_empty(s->hidden_disk, errp); if (ret < 0) { return; }