From nobody Sun Feb 8 21:28:44 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=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1560249045; cv=none; d=zoho.com; s=zohoarc; b=BS4WUaEvhMX4zg9wVRvPBUc9YI9VAZyI1T8+qfonfXNvva149Dmbmj+tgMMj+JQlwWs+vlFL7dEMNFizHBhbPQfXgLDM44y2vgGNLEY9jmtWeMzCpTguejJIGzDiwjdo3LH7OcZei5crycIeHk0jcRGexyxphqPYg52T/xUQ+n4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560249045; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=wZazvQE+pSpQuQ5NUGiJAWa1F9Q/pfYR7E3vtpUXcy8=; b=iJ3yHLtRav12JkJcf2RPWN0exWy264wqfzHUycPw6WwuxSZhPP/mVqkXY8Im3pCPt9ewF3h0NJTg1H58FxuqEIkf9MAtCl7tycRGRCLmvtO1+b6E0bGHv+ulbd2sYPBR1My2q1IJQeA56AjBsBeTPzTun+fNBlmfTcb67REeLro= 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 1560249045281710.7795283332317; Tue, 11 Jun 2019 03:30:45 -0700 (PDT) Received: from localhost ([::1]:55980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hae34-00040N-99 for importer@patchew.org; Tue, 11 Jun 2019 06:30:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60365) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hae06-0002E1-Tw for qemu-devel@nongnu.org; Tue, 11 Jun 2019 06:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hae00-0001D7-Gu for qemu-devel@nongnu.org; Tue, 11 Jun 2019 06:27:31 -0400 Received: from relay.sw.ru ([185.231.240.75]:45604) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hadzy-0001Aa-D0; Tue, 11 Jun 2019 06:27:27 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1hadzt-00083J-LK; Tue, 11 Jun 2019 13:27:21 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Tue, 11 Jun 2019 13:27:18 +0300 Message-Id: <20190611102720.86114-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190611102720.86114-1-vsementsov@virtuozzo.com> References: <20190611102720.86114-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 1/3] 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: kwolf@redhat.com, vsementsov@virtuozzo.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Drop one on failure path (we have errp) and turn two others into trace points. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-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 09e03013d2..231dc13c48 100644 --- a/block/nbd-client.h +++ b/block/nbd-client.h @@ -6,15 +6,6 @@ #include "block/block_int.h" #include "io/channel-socket.h" =20 -/* #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 =20 typedef struct { diff --git a/block/nbd-client.c b/block/nbd-client.c index 790ecc1ee1..f89a67c23b 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -1136,7 +1136,7 @@ static int nbd_client_connect(BlockDriverState *bs, } =20 /* NBD handshake */ - logout("session init %s\n", export); + trace_nbd_client_connect(export); qio_channel_set_blocking(QIO_CHANNEL(sioc), true, NULL); =20 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)); =20 - logout("Established connection with NBD server\n"); + trace_nbd_client_connect_success(export); + return 0; =20 fail: diff --git a/block/trace-events b/block/trace-events index eab51497fc..01fa5eb081 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'" =20 # ssh.c ssh_restart_coroutine(void *co) "co=3D%p" --=20 2.18.0