From nobody Mon Feb 9 18:46:11 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 1499957209545944.4284089382488; Thu, 13 Jul 2017 07:46:49 -0700 (PDT) Received: from localhost ([::1]:60461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVfOB-0004iE-4D for importer@patchew.org; Thu, 13 Jul 2017 10:46:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVf3g-0001Ev-Ka for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:25:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVf3f-0002gV-F2 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:25:36 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVf3f-0002et-8j for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:25:35 -0400 Received: by mail-wm0-x244.google.com with SMTP id y5so5447973wmh.3 for ; Thu, 13 Jul 2017 07:25:35 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 07:25:32 -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=ROpYbrYbWuRQD/9VG2hiw6xBGJ+TPhuui2kbrVihR7s=; b=JzGTwr0p8caEwevuG63Aa1tDIMoPhvWWN9Gl0wYv+AvoeNW6plzD2JfBj+wqcmrKLp ImKluVak74ehkaLTxGz+CqIE6YrNh61UlyUuYYmtDrs5eJaKAl9hnVCkcZ4vpw90l9/R Tlg7G1C7n29ohZ4w7T+6CrykcY/+KynFQKItc3W5qZwDGTBsofw50926Xl+mOLnITP5o qV8VSyV/tFVl/zpLiJ5yMBxEVyYTjp5R35p/8ITPWmhlvSoWKx8BVgjeAdmrzhWag7L+ +XBbBIMARwZ/Df6XoLOQcyelFjpLuvEwfAmmb2rY78rX5Xx7WdIAEC3aOC0k2egaXeoI lljA== 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=ROpYbrYbWuRQD/9VG2hiw6xBGJ+TPhuui2kbrVihR7s=; b=HoEnh2X1br+fl8y4HGVmOA714fsIVh9NPtGL10s2NgoSeNNhlx4ccmZL77jQqbxZ52 7ruT2KZU6eBuj9XitFajAfk3l80dPCl3fKAFYcuAutMtc6xniyojJZRmPE1Ihsn7lmC6 YcMRZpl1WwzGSfI6w0mS3fizN3SEPYxgydqSrWPWDwK4Rhzhu0Y1hBs0nU1+sEMH7HDa xUP8pfi9t3DGjnsaDVB4tIiHjQtDfdrban417PicSu9XNFnEyr0/7yNJpHkwpaPTOhr9 oglrjloC5noPIr8MSfluqfHgmDzupNuugdYJgiBKzlgNqvaQjpROLTiHHs/CnjUOC7jt QxPQ== X-Gm-Message-State: AIVw110NTp6mU8rzUvANwpFX6A5/2hCY8qhD64MDmp3EoNrsayKR0PLG R+CC5yH9O3RSoIMUpFw= X-Received: by 10.28.168.21 with SMTP id r21mr2319084wme.80.1499955934131; Thu, 13 Jul 2017 07:25:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 16:24:27 +0200 Message-Id: <1499955874-10954-35-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: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 34/41] nbd: Simplify trace of client flags in negotiation 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 Simplify the tracing of client flags in the server, and return -EINVAL instead of -EIO if we successfully read but don't like those flags. Signed-off-by: Eric Blake Message-Id: <20170707203049.534-5-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- nbd/server.c | 6 ++---- nbd/trace-events | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 27a0aab..8e363d3 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -396,21 +396,19 @@ static int nbd_negotiate_options(NBDClient *client, E= rror **errp) error_prepend(errp, "read failed: "); return -EIO; } - trace_nbd_negotiate_options_flags(); be32_to_cpus(&flags); + trace_nbd_negotiate_options_flags(flags); if (flags & NBD_FLAG_C_FIXED_NEWSTYLE) { - trace_nbd_negotiate_options_newstyle(); fixedNewstyle =3D true; flags &=3D ~NBD_FLAG_C_FIXED_NEWSTYLE; } if (flags & NBD_FLAG_C_NO_ZEROES) { - trace_nbd_negotiate_options_no_zeroes(); client->no_zeroes =3D true; flags &=3D ~NBD_FLAG_C_NO_ZEROES; } if (flags !=3D 0) { error_setg(errp, "Unknown client flags 0x%" PRIx32 " received", fl= ags); - return -EIO; + return -EINVAL; } =20 while (1) { diff --git a/nbd/trace-events b/nbd/trace-events index 5e2f961..8db0500 100644 --- a/nbd/trace-events +++ b/nbd/trace-events @@ -35,9 +35,7 @@ nbd_negotiate_handle_export_name(void) "Checking length" nbd_negotiate_handle_export_name_request(const char *name) "Client request= ed export '%s'" nbd_negotiate_handle_starttls(void) "Setting up TLS" nbd_negotiate_handle_starttls_handshake(void) "Starting TLS handshake" -nbd_negotiate_options_flags(void) "Checking client flags" -nbd_negotiate_options_newstyle(void) "Client supports fixed newstyle hands= hake" -nbd_negotiate_options_no_zeroes(void) "Client supports no zeroes at handsh= ake end" +nbd_negotiate_options_flags(uint32_t flags) "Received client flags 0x%" PR= Ix32 nbd_negotiate_options_check_magic(uint64_t magic) "Checking opts magic 0x%= " PRIx64 nbd_negotiate_options_check_option(uint32_t option, const char *name) "Che= cking option 0x%" PRIx32 " (%s)" nbd_negotiate_begin(void) "Beginning negotiation" --=20 1.8.3.1