Blame SOURCES/kvm-nbd-server-fix-trace.patch

383d26
From 4b09857fcf27b4803336119b06033766d474ea54 Mon Sep 17 00:00:00 2001
383d26
From: John Snow <jsnow@redhat.com>
383d26
Date: Wed, 18 Jul 2018 22:55:00 +0200
383d26
Subject: [PATCH 75/89] nbd/server: fix trace
383d26
383d26
RH-Author: John Snow <jsnow@redhat.com>
383d26
Message-id: <20180718225511.14878-25-jsnow@redhat.com>
383d26
Patchwork-id: 81401
383d26
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 24/35] nbd/server: fix trace
383d26
Bugzilla: 1207657
383d26
RH-Acked-by: Eric Blake <eblake@redhat.com>
383d26
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
383d26
RH-Acked-by: Fam Zheng <famz@redhat.com>
383d26
383d26
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
383d26
383d26
Return code = 1 doesn't mean that we parsed base:allocation. Use
383d26
correct traces in both -parsed and -skipped cases.
383d26
383d26
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
383d26
Message-Id: <20180609151758.17343-2-vsementsov@virtuozzo.com>
383d26
Reviewed-by: Eric Blake <eblake@redhat.com>
383d26
[eblake: comment tweaks]
383d26
Signed-off-by: Eric Blake <eblake@redhat.com>
383d26
(cherry picked from commit dbb8b396bb46388cee92e9094c563297d04c43ed)
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 nbd/server.c | 14 ++++++++++----
383d26
 1 file changed, 10 insertions(+), 4 deletions(-)
383d26
383d26
diff --git a/nbd/server.c b/nbd/server.c
383d26
index 493a926..942c016 100644
383d26
--- a/nbd/server.c
383d26
+++ b/nbd/server.c
383d26
@@ -736,12 +736,16 @@ static int nbd_negotiate_send_meta_context(NBDClient *client,
383d26
 
383d26
 /* nbd_meta_base_query
383d26
  *
383d26
- * Handle query to 'base' namespace. For now, only base:allocation context is
383d26
- * available in it.  'len' is the amount of text remaining to be read from
383d26
+ * Handle queries to 'base' namespace. For now, only the base:allocation
383d26
+ * context is available.  'len' is the amount of text remaining to be read from
383d26
  * the current name, after the 'base:' portion has been stripped.
383d26
  *
383d26
  * Return -errno on I/O error, 0 if option was completely handled by
383d26
- * sending a reply about inconsistent lengths, or 1 on success. */
383d26
+ * sending a reply about inconsistent lengths, or 1 on success.
383d26
+ *
383d26
+ * Note: return code = 1 doesn't mean that we've parsed the "base:allocation"
383d26
+ * namespace. It only means that there are no errors.
383d26
+ */
383d26
 static int nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
383d26
                                uint32_t len, Error **errp)
383d26
 {
383d26
@@ -768,10 +772,12 @@ static int nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
383d26
     }
383d26
 
383d26
     if (strncmp(query, "allocation", alen) == 0) {
383d26
+        trace_nbd_negotiate_meta_query_parse("base:allocation");
383d26
         meta->base_allocation = true;
383d26
+    } else {
383d26
+        trace_nbd_negotiate_meta_query_skip("not base:allocation");
383d26
     }
383d26
 
383d26
-    trace_nbd_negotiate_meta_query_parse("base:allocation");
383d26
     return 1;
383d26
 }
383d26
 
383d26
-- 
383d26
1.8.3.1
383d26