From nobody Sun May 19 12:00:50 2024 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=1557174912; cv=none; d=zoho.com; s=zohoarc; b=Kexsyq6UKIb1QRBEwEAoQ2nraCeQzSAFP8aK2SBKetgRMaj1sG8HHG6Q9H8Y3Sl06r4Vo4zSa22RD1gvZ/omhT4A8wkTtYj/ewJ7fCN6/NiuylMrFn/S4Do4pmfO+SaRyBZz4a4tNC1CgFr5F4Cl6gztyOm+jSRy+tsWtURhvas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557174912; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=LspfxLJ8NjgUSprEFAb/bXt949vImo1mH5YIuKdWNog=; b=ltP/kb3qGZPur+kJX3a+hiC3+UEjPM7vAlT/1duSgTizeRHCF18kQargNFwMR1XHa2Nn6N5iBsicnC1UTLXisbhsbTLhoD3e3F05zN6acosLpB2y6qilNo0TNpMQpHGP5Ed65kZkY9ZQ3castbfonOxczSPXN+RmA2am3r4gqT0= 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 155717491240262.31106576958973; Mon, 6 May 2019 13:35:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:33692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNkKD-0005Vf-Ks for importer@patchew.org; Mon, 06 May 2019 16:35:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNkJ7-00054S-Mm for qemu-devel@nongnu.org; Mon, 06 May 2019 16:33:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNkJ6-0004FN-LG for qemu-devel@nongnu.org; Mon, 06 May 2019 16:33:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33530) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNkJ4-0004DE-Gv; Mon, 06 May 2019 16:33:50 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1860305B886; Mon, 6 May 2019 20:33:47 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-164.bos.redhat.com [10.18.17.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8D9460BEC; Mon, 6 May 2019 20:33:44 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Mon, 6 May 2019 16:33:44 -0400 Message-Id: <20190506203344.30781-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 06 May 2019 20:33:48 +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] [PATCH] blockdev-backup: don't check aio_context too early 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: Kevin Wolf , aihua liang , qemu-block@nongnu.org, Markus Armbruster , qemu-stable@nongnu.org, Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 --- blockdev.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index 79fbac8450..a81d88980c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1872,10 +1872,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.20.1