From nobody Mon Feb 9 10:58:18 2026 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=1560446779; cv=none; d=zoho.com; s=zohoarc; b=T2HgvtzHN2drFKjYcRPqgTOyonM1/+u1LNR6Sp0LCgzCypKW2EehT7yYNBP7S/TczXu0q2S//r9bXkqPd5Dk29i+x4sKrRFFMiKiZPfkF2Gm8YGlEhdhpjsutnlJ3sO6kzNKn+GHzjW7LXG6YdZ8vZZp1Qk3w92Xfo63+Tmqbe8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560446779; 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=mTvA5cS3WnQUUYEuk4IK/qzBXdXP9J3HUB/LKkNRUH4=; b=VIOa7D7b9weOHoVM96woIrM5obj1gVfFPLKl+4l0cQnIkeBgC1TdGDDVYZSuhLqPdk6pgssYpb8Iwuk+js3JsuEX8S0k5YHL017XUop4J53jNEn1yt1pJBg4JRVs5QVLbHFgpQMCcNVrAq4Fbapz0shzXlBWkIjnrqOMjBEMBkI= 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 156044677914411.666777029101468; Thu, 13 Jun 2019 10:26:19 -0700 (PDT) Received: from localhost ([::1]:42278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbTSI-0001dw-G5 for importer@patchew.org; Thu, 13 Jun 2019 13:24:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35740) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbRyS-0002uM-EY for qemu-devel@nongnu.org; Thu, 13 Jun 2019 11:49:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbRyQ-0006iU-Vf for qemu-devel@nongnu.org; Thu, 13 Jun 2019 11:49:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbRy9-0006XN-8C; Thu, 13 Jun 2019 11:48:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2567BB2DCE; Thu, 13 Jun 2019 15:48:52 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-85.phx2.redhat.com [10.3.116.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33F197C581; Thu, 13 Jun 2019 15:48:49 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 10:48:35 -0500 Message-Id: <20190613154837.21734-8-eblake@redhat.com> In-Reply-To: <20190613154837.21734-1-eblake@redhat.com> References: <20190613154837.21734-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 13 Jun 2019 15:48:52 +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 7/9] block/nbd-client: drop stale logout 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 , Vladimir Sementsov-Ogievskiy , "open list:Network Block Dev..." , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Drop one on failure path (we have errp) and turn two others into trace points. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20190611102720.86114-2-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- block/nbd-client.h | 9 --------- block/nbd-client.c | 6 +++--- block/trace-events | 2 ++ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/block/nbd-client.h b/block/nbd-client.h index 4587053114af..570538f4c884 100644 --- a/block/nbd-client.h +++ b/block/nbd-client.h @@ -5,15 +5,6 @@ #include "block/block_int.h" #include "io/channel-socket.h" -/* #define DEBUG_NBD */ - -#if defined(DEBUG_NBD) -#define logout(fmt, ...) \ - fprintf(stderr, "nbd\t%-24s" fmt, __func__, ##__VA_ARGS__) -#else -#define logout(fmt, ...) ((void)0) -#endif - #define MAX_NBD_REQUESTS 16 typedef struct { diff --git a/block/nbd-client.c b/block/nbd-client.c index 790ecc1ee1cb..f89a67c23b64 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -1136,7 +1136,7 @@ static int nbd_client_connect(BlockDriverState *bs, } /* NBD handshake */ - logout("session init %s\n", export); + trace_nbd_client_connect(export); qio_channel_set_blocking(QIO_CHANNEL(sioc), true, NULL); client->info.request_sizes =3D true; @@ -1149,7 +1149,6 @@ static int nbd_client_connect(BlockDriverState *bs, g_free(client->info.x_dirty_bitmap); g_free(client->info.name); if (ret < 0) { - logout("Failed to negotiate with the NBD server\n"); object_unref(OBJECT(sioc)); return ret; } @@ -1187,7 +1186,8 @@ static int nbd_client_connect(BlockDriverState *bs, bdrv_inc_in_flight(bs); nbd_client_attach_aio_context(bs, bdrv_get_aio_context(bs)); - logout("Established connection with NBD server\n"); + trace_nbd_client_connect_success(export); + return 0; fail: diff --git a/block/trace-events b/block/trace-events index eab51497fc0f..01fa5eb081be 100644 --- a/block/trace-events +++ b/block/trace-events @@ -165,6 +165,8 @@ nbd_parse_blockstatus_compliance(const char *err) "igno= ring extra data from non- nbd_structured_read_compliance(const char *type) "server sent non-complian= t unaligned read %s chunk" nbd_read_reply_entry_fail(int ret, const char *err) "ret =3D %d, err: %s" nbd_co_request_fail(uint64_t from, uint32_t len, uint64_t handle, uint16_t= flags, uint16_t type, const char *name, int ret, const char *err) "Request= failed { .from =3D %" PRIu64", .len =3D %" PRIu32 ", .handle =3D %" PRIu64= ", .flags =3D 0x%" PRIx16 ", .type =3D %" PRIu16 " (%s) } ret =3D %d, err:= %s" +nbd_client_connect(const char *export_name) "export '%s'" +nbd_client_connect_success(const char *export_name) "export '%s'" # ssh.c ssh_restart_coroutine(void *co) "co=3D%p" --=20 2.20.1