From nobody Thu Dec 18 13:17:49 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560520436; cv=none; d=zoho.com; s=zohoarc; b=BTXFKMs2zhBjbujtigRoG9y8zhC1ih6H+dtdSzmsDIO9LrD8JGvvLKCsPLZSRigQIhGnjdY3lxUBFBPN0+PzXbB+ZJxH8oZkf/lzS/aRXNlAoBpm2OimTO8XATI05Lz2eoSiL6eOuh4nXmf4j8owPXOjQKrRZinIvftFfhfFZyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560520436; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=t7M4nDgJ1DR1S59JJCJNFkvjsFsupSHzriIn1u/+XRc=; b=UgGat9xbaGx/RpPbjD99iPBDIOnIy3zHBbpbpEXxr1w8Kl3io7Emy1qdDZTfK3uemS9dd5GTXIxO63zmMHjlaj5akLJjrWAn4umuK55L6PtwSF4Ngsc7nK1s7hTxzCS3MWTddgQTplckdT4P4N1aC786fvyUlfiIy9UK5XclWJ4= 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 1560520436147953.751480294271; Fri, 14 Jun 2019 06:53:56 -0700 (PDT) Received: from localhost ([::1]:51738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbmeM-0000WV-HL for importer@patchew.org; Fri, 14 Jun 2019 09:53:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46291) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbmRd-0001dF-F0 for qemu-devel@nongnu.org; Fri, 14 Jun 2019 09:40:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbmRc-0005ol-AQ for qemu-devel@nongnu.org; Fri, 14 Jun 2019 09:40:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44781) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbmRW-0005jG-Bj; Fri, 14 Jun 2019 09:40:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B45D72EED2D; Fri, 14 Jun 2019 13:40:25 +0000 (UTC) Received: from localhost (unknown [10.40.205.125]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 426507F464; Fri, 14 Jun 2019 13:40:25 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 14 Jun 2019 15:40:02 +0200 Message-Id: <20190614134021.32486-2-mreitz@redhat.com> In-Reply-To: <20190614134021.32486-1-mreitz@redhat.com> References: <20190614134021.32486-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 14 Jun 2019 13:40:30 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/20] blockdev-backup: don't check aio_context too early 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: John Snow in blockdev_backup_prepare, we check to make sure that the target is associated with a compatible aio context. However, do_blockdev_backup is called later and has some logic to move the target to a compatible aio_context. The transaction version will fail certain commands needlessly early as a result. Allow blockdev_backup_prepare to simply call do_blockdev_backup, which will ultimately decide if the contexts are compatible or not. Note: the transaction version has always disallowed this operation since its initial commit bd8baecd (2014), whereas the version of qmp_blockdev_backup at the time, from commit c29c1dd312f, tried to enforce the aio_context switch instead. It's not clear, and I can't see from the mailing list archives at the time, why the two functions take a different approach. It wasn't until later in efd7556708b (2016) that the standalone version tried to determine if it could set the context or not. Reported-by: aihua liang Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D1683498 Signed-off-by: John Snow Message-id: 20190523170643.20794-2-jsnow@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- blockdev.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index 3f44b891eb..fdafa173cc 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1876,10 +1876,6 @@ static void blockdev_backup_prepare(BlkActionState *= common, Error **errp) } =20 aio_context =3D bdrv_get_aio_context(bs); - if (aio_context !=3D bdrv_get_aio_context(target)) { - error_setg(errp, "Backup between two IO threads is not implemented= "); - return; - } aio_context_acquire(aio_context); state->bs =3D bs; =20 --=20 2.21.0