From nobody Sat Feb 7 05:33:58 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 14975563400361002.2041962898087; Thu, 15 Jun 2017 12:52:20 -0700 (PDT) Received: from localhost ([::1]:55632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLaoU-0000N3-78 for importer@patchew.org; Thu, 15 Jun 2017 15:52:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLanT-0008PH-VE for qemu-devel@nongnu.org; Thu, 15 Jun 2017 15:51:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLanR-0006Cd-Ei for qemu-devel@nongnu.org; Thu, 15 Jun 2017 15:51:16 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLanR-0006Bk-7Q; Thu, 15 Jun 2017 15:51:13 -0400 Received: by mail-wr0-x244.google.com with SMTP id x23so4638438wrb.0; Thu, 15 Jun 2017 12:51:13 -0700 (PDT) Received: from localhost.localdomain (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id r40sm239541wrb.37.2017.06.15.12.51.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jun 2017 12:51:11 -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=qvKa4TfyEJoXt/6rjsZBgmz47gxdzOv9QWGitJfSX8hPXj8OkSTU1K6WrfZT4CR2LQ 5qFvN8XjiRWQyluyN9C4zDck0qR7GX+ep9M8gZ0YU7JOtwZr+Mvp8gu3zYJ3YX1xGqoW Zhsu+HC4PRxJ3IuRRkp9so/vEUoCIO4kDY/RLhzpImCYdlClctl5Epd/+yyhjbiz7Krw 7AZWCe7qRXPVfaKzg5a3Fbx93vp1a4PKBkAQFP0ixcbI/BN5J9/HAV0Nj5FwzmF4T7PG AwUXitSm2M3CJ1MzhwBabPmn0jtBe5tus445CEg/qFRqfb0L9xQxj8C4LlqmMxLep0qi I0yA== 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=MYF5n+AcNuUK3TqgFGTI6Lp1wyDGFeHY61wS6fHBKWyKC6suVcqWHAxK5+jTYV6bKB 5IEry4eFL33buJ5XAkGMT61DTMYsBNv2XSB+1insquloCSWmSnt+CAcmYj3HcDHT6K+M gWC+JcsybcXdiaSjcOBfJwvjSafjAxzT00cFCrxvzNM9sT/UaEuZJVr8OF8wzMPa4Qo5 vYm0OSLSoRNNkVUp2IDJFIL3laFx3lI7jBDEL5Ey3drcxeEHrY29JRvfntIBUtdr+LwH mdLnVZ+gDbKrM2BAxeCOD2vt0l1fDmBisSWCpVbliC6i8RtI5u3Rxs82mlGZhewu2SLN 16Ng== X-Gm-Message-State: AKS2vOzo+YhAN1Ud7gKSpIQOZ7wsoJt9C7RZOeioT6qoTeEw0BALUpQE avAT/k/2/ZrcKiMlkDE= X-Received: by 10.223.136.37 with SMTP id d34mr5186846wrd.160.1497556271851; Thu, 15 Jun 2017 12:51:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 15 Jun 2017 21:51:10 +0200 Message-Id: <20170615195110.17479-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:c0c::244 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: Eric Blake --- 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