From nobody Mon Feb 9 23:29:51 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.zoho.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 1497556415112140.6868241241009; Thu, 15 Jun 2017 12:53:35 -0700 (PDT) Received: from localhost ([::1]:55638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLape-00019g-Vw for importer@patchew.org; Thu, 15 Jun 2017 15:53:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLaoR-0000RM-CW for qemu-devel@nongnu.org; Thu, 15 Jun 2017 15:52:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLaoO-0007Ey-SY for qemu-devel@nongnu.org; Thu, 15 Jun 2017 15:52:15 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLaoO-0007DN-Mh; Thu, 15 Jun 2017 15:52:12 -0400 Received: by mail-wm0-x241.google.com with SMTP id d17so1489279wme.3; Thu, 15 Jun 2017 12:52:12 -0700 (PDT) Received: from donizetti.redhat.com (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id k19sm162612wmg.9.2017.06.15.12.52.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jun 2017 12:52:10 -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; bh=v3otwjon9ZA21CwdbHvis7i4vgA3U9EYUjYX4vyDJ9M=; b=Qtxis9EwXwS/4dL8ChlcWFCjHBUUt6m8oY0i56C8OZSXcpIzzrVV36o6+5tDR0o3gL GZFQcO5Gfo0bDe+pV5BCFQ5RrsUA0+mNmll/KTiBUXffIGAHIVtQfH3ePYhroNs2M+l9 vYpB4RnhJdeXJKAjxsSy57Jy7myFY1nuT3wQHdWwRBoiTvDJyqCsxQb9gwOIC9ddau7G IkoVyCrUFJhAnVtgoRNZCar79N+eWlKPT7TnMMVxB2IGco9ZdxGxrVY06UGu/XzkLtig QmW3Qc1KH9ClXpRQ5NPLxgDMfG6yXSyxSILvkss9jDi57F9FQjZDTuXBMNSWnojE6tyi Fdog== 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; bh=v3otwjon9ZA21CwdbHvis7i4vgA3U9EYUjYX4vyDJ9M=; b=RE3lNrhbRsfZPlNKDdBWzy8z4W7FiMkAoPsqOl7x4sfuPJaDgNrVlMm9HlRmR98SGd TFk8gVCJJ1BzIy5mOmBJy//RC05icDwuvhyJpKSy0ZN9K6sGI7QOj85CmwyoXjaTcQx9 d4GG4jXAwYZZ4afG+r6VO1r3xvsEGyTdC8R10p3ONj3md9T2uloowlDEB8+c49aaFDL1 zRO1XAV/rTj09gD4ufPv5A3u8hwLOgGDhAqm7sEZsBGy3DiSOmSwBvqr6FEC3JGtkK0x p7bmSSBWZrUfaxt6mHj5px4KkLqIGEKxWbT5zgND59JTg/wmyWVcleELm9LqfXwmV/md 5NVA== X-Gm-Message-State: AKS2vOw32lUfsoDXgHjUfBU4BHs2xQGHq0AZXbV0JMVh3BnAf8pGGGFQ Jw53RpX9sfy+p1DGCtc= X-Received: by 10.28.196.142 with SMTP id u136mr4883395wmf.25.1497556331339; Thu, 15 Jun 2017 12:52:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 15 Jun 2017 21:52:09 +0200 Message-Id: <20170615195209.17720-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH] 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, qemu-block@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 Cc: Daniel P. Berrange Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange Reviewed-by: Stefan Hajnoczi Tested-by: Daniel P. Berrange --- 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 1e2952fdae..56eb0e2e16 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -352,14 +352,14 @@ int nbd_client_co_pdiscard(BlockDriverState *bs, int6= 4_t offset, int count) 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 2.13.0