qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 2/9] nbd: Don't bother tracing an NBD_OPT_ABO


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH v5 2/9] nbd: Don't bother tracing an NBD_OPT_ABORT response failure
Date: Thu, 13 Jul 2017 15:12:58 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

07.07.2017 23:30, Eric Blake wrote:
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 <address@hidden>

---
v5: new patch
---
  nbd/server.c | 15 ++++-----------
  1 file changed, 4 insertions(+), 11 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, Error 
**errp)
  {
      uint32_t flags;
      bool fixedNewstyle = false;
-    Error *local_err = NULL;

      /* Client sends:
          [ 0 ..   3]   client flags
@@ -479,7 +478,9 @@ static int nbd_negotiate_options(NBDClient *client, Error 
**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 == NBD_OPT_ABORT) {
                      return 1;
                  }
@@ -498,15 +499,7 @@ static int nbd_negotiate_options(NBDClient *client, Error 
**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 != NULL) {
-                    const char *error = error_get_pretty(local_err);
-                    trace_nbd_opt_abort_reply_failed(error);

Looks like you forgot to drop this trace from nbd/trace-events

-                    error_free(local_err);
-                }
-
+                nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, option, NULL);
                  return 1;

              case NBD_OPT_EXPORT_NAME:


--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]