From nobody Mon Feb 9 18:46:10 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 1499957350502535.5655013588863; Thu, 13 Jul 2017 07:49:10 -0700 (PDT) Received: from localhost ([::1]:60473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVfQQ-0006oR-76 for importer@patchew.org; Thu, 13 Jul 2017 10:49:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVf4e-00025V-BG for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:26:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVf4a-0004Q4-8y for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:26:36 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34861) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVf4a-0004Pg-1c for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:26:32 -0400 Received: by mail-wr0-f194.google.com with SMTP id y28so4892105wrd.2 for ; Thu, 13 Jul 2017 07:26:31 -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 k75sm6042448wmh.10.2017.07.13.07.25.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 07:25:27 -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=E78CqE7L5NGGWGyI0zBEc07d2C0Ja+NGdwmRn8n6j44=; b=tEsrt89L6e2B8HagW+uQ5B9TvNZc7iRyHFlxr6Qn2HGixsCBMvb5WgYATB9mrTgJsG 0krIWmEliLAs4SVut963Q+HxAjuQdHmXYHgu4aVKSRjgiVt0qyo1CkWqWvZWzTgJxYhE EuqaYFL5ckskVGmWiFe8SHERrjdDBZZVuDA5xqo8eHvsncqbZ0d15ib4VBJTOW4pkp2l gAj2fUR7Vyvv5fRi/sSPvPfeRKJCKIhORJyuY7KOoWIYeU7uyF0lnciL95CcAiIlIWK2 hDpVd8AdFN2EAJMRhq6qG/Nif0N2MFWYHGCCpIDzXIgQGonNbwwebGWsPZbFdodcrnT0 D/BA== 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=E78CqE7L5NGGWGyI0zBEc07d2C0Ja+NGdwmRn8n6j44=; b=DGJkUYszJGTVj7qDbidK00bbJW0tdw3koMsohV01+961EXf8dsbw/4uOzX1HK62nca UD7bspXtg9bTS2diYUPjIqLKqVfofcgcFDFYnH5TBFvSX5Zx6aybiSonD2zY6Nxr8WD7 emSwVjEfn8IwFL2VwIEhSCiBViGmAEqrnEs9zamjBvjDLa9DpQHf8SCLf7MvL88OAOHi ffdfphnOPZD57pkYn7op8m9aZNTIXtC4IdHGSqPnV2toyyVReCz22QSemCq59O7zrf9Y T5A0FVcjXxuANsRPkAyrt+MrXoq2yn+Y//Di+LHNPyfT1KrSGKPz7yzFlAKTAa0h/4U0 fpLg== X-Gm-Message-State: AIVw110wRKDocNjYdLRcvzpGC/fM4Q7rCZQNzI5wEMmLvRGASz4Bo1Ax n3OU4M7uzvpRxXxqR1I= X-Received: by 10.223.148.37 with SMTP id 34mr1726438wrq.137.1499955929634; Thu, 13 Jul 2017 07:25:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 16:24:25 +0200 Message-Id: <1499955874-10954-33-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499955874-10954-1-git-send-email-pbonzini@redhat.com> References: <1499955874-10954-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.194 Subject: [Qemu-devel] [PULL 32/41] nbd: Don't bother tracing an NBD_OPT_ABORT response failure 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: , 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" From: Eric Blake We really don't care if our spec-compliant reply to NBD_OPT_ABORT was received, so shave off some lines of code by not even tracing it. Signed-off-by: Eric Blake Message-Id: <20170707203049.534-3-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- nbd/server.c | 15 ++++----------- nbd/trace-events | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 9b0c588..e15385b 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -376,7 +376,6 @@ static int nbd_negotiate_options(NBDClient *client, Err= or **errp) { uint32_t flags; bool fixedNewstyle =3D false; - Error *local_err =3D NULL; =20 /* Client sends: [ 0 .. 3] client flags @@ -479,7 +478,9 @@ static int nbd_negotiate_options(NBDClient *client, Err= or **errp) if (ret < 0) { return ret; } - /* Let the client keep trying, unless they asked to quit */ + /* Let the client keep trying, unless they asked to + * quit. In this mode, we've already sent an error, so + * we can't ack the abort. */ if (option =3D=3D NBD_OPT_ABORT) { return 1; } @@ -498,15 +499,7 @@ static int nbd_negotiate_options(NBDClient *client, Er= ror **errp) /* NBD spec says we must try to reply before * disconnecting, but that we must also tolerate * guests that don't wait for our reply. */ - nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, option, - &local_err); - - if (local_err !=3D NULL) { - const char *error =3D error_get_pretty(local_err); - trace_nbd_opt_abort_reply_failed(error); - error_free(local_err); - } - + nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, option, N= ULL); return 1; =20 case NBD_OPT_EXPORT_NAME: diff --git a/nbd/trace-events b/nbd/trace-events index 4b233b8..c6f898e 100644 --- a/nbd/trace-events +++ b/nbd/trace-events @@ -40,7 +40,6 @@ nbd_negotiate_options_newstyle(void) "Client supports fix= ed newstyle handshake" nbd_negotiate_options_no_zeroes(void) "Client supports no zeroes at handsh= ake end" nbd_negotiate_options_check_magic(uint64_t magic) "Checking opts magic 0x%= " PRIx64 nbd_negotiate_options_check_option(uint32_t option) "Checking option 0x%" = PRIx32 -nbd_opt_abort_reply_failed(const char *error) "Reply to NBD_OPT_ABORT requ= est failed: %s" nbd_negotiate_begin(void) "Beginning negotiation" nbd_negotiate_old_style(uint64_t size, unsigned flags) "advertising size %= " PRIu64 " and flags %x" nbd_negotiate_new_style_size_flags(uint64_t size, unsigned flags) "adverti= sing size %" PRIu64 " and flags %x" --=20 1.8.3.1