From nobody Mon Feb 9 11:51:23 2026 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.zohomail.com; dkim=fail; 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 1499239167477827.0951623381058; Wed, 5 Jul 2017 00:19:27 -0700 (PDT) Received: from localhost ([::1]:44496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeas-0008Rc-5Z for importer@patchew.org; Wed, 05 Jul 2017 03:19:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWX-0004Mj-Ks for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWU-0007PY-Bs for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:57 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWU-0007P8-5f; Wed, 05 Jul 2017 03:14:54 -0400 Received: by mail-wm0-x244.google.com with SMTP id p204so30533448wmg.1; Wed, 05 Jul 2017 00:14:54 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gflYPpeJSs2azKKiKscSbInK8sDrp1zU2ymU9ukQ4Rw=; b=XzDGG3fwudOoTU5MGQuFM1Y9yN62uvicVAN6bgrPTxgv+ZnYlGxuT5iyyhqw/B4P6y V85BSMSbqOocUEL3/G98LKOGQhbXsO68SYp7vFDO0RY8NnbjAC8Tnb7ckImvGVB5L9EO zZ09qOii0F0pk98dWpoLDbMuw+dT07YXGCKZKrqUXK/hPl78LHm7b9ygCI08iHRbPzbx PVLrvm4iNnlMbBCSaOvCysUURW8u7W2pd7tKwnAJbCeQm80iiX0ms8rQkLPHQ35Z2nBu CtNKF+k56jnvaXGAhmVuhCvubu+KpH88vq0fiIl/L+3Fj8XdRB/yubFTJ5AoGnDKfqSK ySUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=gflYPpeJSs2azKKiKscSbInK8sDrp1zU2ymU9ukQ4Rw=; b=RCuJbWTfyVD3z/GUEeFbS66If6OhuH21v1hB4z0J3FacP6LbzQ671Xl+0kJJbeWWVk KtSqnrP4XmUxsuiKPDdhWvey6SAxSY4RWzMqZBqvxUoOq5cT68LeZtI6079gA2147VEO Xx1xZ4LGN0VFlYYQeqOLQfcdzyx4PAyWV53UnbgrnxJvPxrNNY4Ypejqmj/AKPPlx1dk oFafm1KVmFuJiH37xGOj7UVnThYuUPWSNEs+HgZhGu9AOm/xB5ADxNXTAKWeuP02mVBF OZSYCxRmgA3W7/LcIGK8D3q4aikVOvkPC0bJZ919U+d1DX7zOCardTJS+DsC2a7hb8g+ dScQ== X-Gm-Message-State: AKS2vOwN1UjGiLOsY5RSD/uy7LJ3qL+L9fJ9cDldAfRXA1jtZeLnMj43 HufqV9EpeV/G4qFJApM= X-Received: by 10.28.234.193 with SMTP id g62mr32817002wmi.24.1499238892927; Wed, 05 Jul 2017 00:14:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:06 +0200 Message-Id: <1499238885-26161-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 03/42] nbd: fix NBD over TLS 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: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When attaching the NBD QIOChannel to an AioContext, the TLS channel should be used, not the underlying socket channel. This is because, trivially, the TLS channel will be the one that we read/write to and thus the one that will get the qio_channel_yield() call. Fixes: ff82911cd3f69f028f2537825c9720ff78bc3f19 Cc: qemu-stable@nongnu.org Reviewed-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrange Tested-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- block/nbd-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 02e9281..208f907 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -345,14 +345,14 @@ int nbd_client_co_pdiscard(BlockDriverState *bs, int6= 4_t offset, int bytes) void nbd_client_detach_aio_context(BlockDriverState *bs) { NBDClientSession *client =3D nbd_get_client_session(bs); - qio_channel_detach_aio_context(QIO_CHANNEL(client->sioc)); + qio_channel_detach_aio_context(QIO_CHANNEL(client->ioc)); } =20 void nbd_client_attach_aio_context(BlockDriverState *bs, AioContext *new_context) { NBDClientSession *client =3D nbd_get_client_session(bs); - qio_channel_attach_aio_context(QIO_CHANNEL(client->sioc), new_context); + qio_channel_attach_aio_context(QIO_CHANNEL(client->ioc), new_context); aio_co_schedule(new_context, client->read_reply_co); } =20 --=20 1.8.3.1