qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"open list:Network Block Dev..." <qemu-block@nongnu.org>
Subject: [Qemu-devel] [PULL 2/7] nbd/server: fix trace
Date: Wed, 20 Jun 2018 22:19:52 -0500	[thread overview]
Message-ID: <20180621031957.134718-3-eblake@redhat.com> (raw)
In-Reply-To: <20180621031957.134718-1-eblake@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Return code = 1 doesn't mean that we parsed base:allocation. Use
correct traces in both -parsed and -skipped cases.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: comment tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 nbd/server.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 9e1f2271784..e71301b8cd7 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -736,12 +736,16 @@ static int nbd_negotiate_send_meta_context(NBDClient *client,

 /* nbd_meta_base_query
  *
- * Handle query to 'base' namespace. For now, only base:allocation context is
- * available in it.  'len' is the amount of text remaining to be read from
+ * Handle queries to 'base' namespace. For now, only the base:allocation
+ * context is available.  'len' is the amount of text remaining to be read from
  * the current name, after the 'base:' portion has been stripped.
  *
  * Return -errno on I/O error, 0 if option was completely handled by
- * sending a reply about inconsistent lengths, or 1 on success. */
+ * sending a reply about inconsistent lengths, or 1 on success.
+ *
+ * Note: return code = 1 doesn't mean that we've parsed the "base:allocation"
+ * namespace. It only means that there are no errors.
+ */
 static int nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
                                uint32_t len, Error **errp)
 {
@@ -768,10 +772,12 @@ static int nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
     }

     if (strncmp(query, "allocation", alen) == 0) {
+        trace_nbd_negotiate_meta_query_parse("base:allocation");
         meta->base_allocation = true;
+    } else {
+        trace_nbd_negotiate_meta_query_skip("not base:allocation");
     }

-    trace_nbd_negotiate_meta_query_parse("base:allocation");
     return 1;
 }

-- 
2.14.4

  parent reply	other threads:[~2018-06-21  3:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21  3:19 [Qemu-devel] [PULL 0/7] bitmap export over NBD Eric Blake
2018-06-21  3:19 ` [Qemu-devel] [PULL 1/7] tests: Simplify .gitignore Eric Blake
2018-06-21  3:19 ` Eric Blake [this message]
2018-06-21  3:19 ` [Qemu-devel] [PULL 3/7] nbd/server: refactor NBDExportMetaContexts Eric Blake
2018-06-21  3:19 ` [Qemu-devel] [PULL 4/7] nbd/server: add nbd_meta_empty_or_pattern helper Eric Blake
2018-06-21  3:19 ` [Qemu-devel] [PULL 5/7] nbd/server: implement dirty bitmap export Eric Blake
2018-06-21 10:17   ` Vladimir Sementsov-Ogievskiy
2018-06-21 11:47     ` Eric Blake
2018-06-21  3:19 ` [Qemu-devel] [PULL 6/7] qapi: new qmp command nbd-server-add-bitmap Eric Blake
2018-06-21  3:19 ` [Qemu-devel] [PULL 7/7] docs/interop: add nbd.txt Eric Blake
2018-06-21  5:34 ` [Qemu-devel] [PULL 0/7] bitmap export over NBD no-reply
2018-06-21 11:40   ` Eric Blake
2018-06-21  6:09 ` no-reply
2018-06-21  9:03 ` Peter Maydell
2018-06-21 11:52   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180621031957.134718-3-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).