qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/6] nbd/server: use errp instead of LOG


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH v2 2/6] nbd/server: use errp instead of LOG
Date: Wed, 5 Jul 2017 15:33:56 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Markus, what do you think? I'll resend tomorrow with Eric's comments applied, should I change something with this errp?

29.06.2017 22:27, Eric Blake wrote:
On 06/21/2017 10:34 AM, Vladimir Sementsov-Ogievskiy wrote:

[...]

-static int GCC_FMT_ATTR(4, 5)
+static int GCC_FMT_ATTR(5, 6)
  nbd_negotiate_send_rep_err(QIOChannel *ioc, uint32_t type,
-                           uint32_t opt, const char *fmt, ...)
+                           uint32_t opt, Error **errp, const char *fmt, ...)
  {
Markus, this violates our usual idiom of errp last in code that is not
directly operating on an Error (the actual Error implementation in
error.c being the main obvious exception that lists errp first), but I
don't see any better approach. Do you have any thoughts on it?

-    if (nbd_read(client->ioc, name, length, NULL) < 0) {
-        LOG("read failed");
+    if (nbd_read(client->ioc, name, length, errp) < 0) {
+        error_prepend(errp, "read failed: ");
          return -EINVAL;
      }

[...]


Overall the change looks good to me, but I'll wait to see if Markus has
any design advice before giving my R-b.


--
Best regards,
Vladimir




reply via email to

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