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

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