qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v8 21/21] nbd: assert that Error** is not NULL in nbd_iter_ch


From: Eric Blake
Subject: Re: [PATCH v8 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error
Date: Thu, 5 Dec 2019 11:51:41 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 12/5/19 11:46 AM, Vladimir Sementsov-Ogievskiy wrote:
The local_err parameter is not here to return information about
nbd_iter_channel_error failure. Instead it's assumed to be filled when
passed to the function. This is already stressed by its name
(local_err, instead of classic errp). Stress it additionally by
assertion.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
  block/nbd.c | 1 +
  1 file changed, 1 insertion(+)

Our timing resulted in crossed mails - I was replying to v7 when this landed, and my reply there is still relevant (namely, a better commit message is needed, but the code gets my R-b with that change).


diff --git a/block/nbd.c b/block/nbd.c
index 5f18f78a94..d085554f21 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -866,6 +866,7 @@ typedef struct NBDReplyChunkIter {
  static void nbd_iter_channel_error(NBDReplyChunkIter *iter,
                                     int ret, Error **local_err)
  {
+    assert(local_err && *local_err);
      assert(ret < 0);
if (!iter->ret) {


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

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