All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: mreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com,
	eblake@redhat.com, vsementsov@virtuozzo.com, den@openvz.org
Subject: [Qemu-devel] [PATCH 4/9] block/nbd-client: save first fatal error in nbd_iter_error
Date: Thu, 15 Feb 2018 16:51:42 +0300	[thread overview]
Message-ID: <1518702707-7077-5-git-send-email-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <1518702707-7077-1-git-send-email-vsementsov@virtuozzo.com>

It is ok, that fatal error hides previous not fatal, but hiding
first fatal error is a bad feature.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/nbd-client.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/nbd-client.c b/block/nbd-client.c
index 9206652e45..b1cbe95b13 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -481,6 +481,7 @@ static coroutine_fn int nbd_co_receive_one_chunk(
 
 typedef struct NBDReplyChunkIter {
     int ret;
+    bool fatal;
     Error *err;
     bool done, only_structured;
 } NBDReplyChunkIter;
@@ -490,11 +491,12 @@ static void nbd_iter_error(NBDReplyChunkIter *iter, bool fatal,
 {
     assert(ret < 0);
 
-    if (fatal || iter->ret == 0) {
+    if ((fatal && !iter->fatal) || iter->ret == 0) {
         if (iter->ret != 0) {
             error_free(iter->err);
             iter->err = NULL;
         }
+        iter->fatal = fatal;
         iter->ret = ret;
         error_propagate(&iter->err, *local_err);
     } else {
-- 
2.11.1

  parent reply	other threads:[~2018-02-15 13:52 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 13:51 [Qemu-devel] [PATCH 0/9] nbd block status base:allocation Vladimir Sementsov-Ogievskiy
2018-02-15 13:51 ` [Qemu-devel] [PATCH 1/9] nbd/server: add nbd_opt_invalid helper Vladimir Sementsov-Ogievskiy
2018-02-15 22:01   ` Eric Blake
2018-03-02 12:40     ` Vladimir Sementsov-Ogievskiy
2018-02-15 13:51 ` [Qemu-devel] [PATCH 2/9] nbd: change indenting in nbd.h Vladimir Sementsov-Ogievskiy
2018-02-15 22:03   ` Eric Blake
2018-02-15 13:51 ` [Qemu-devel] [PATCH 3/9] nbd: BLOCK_STATUS for standard get_block_status function: server part Vladimir Sementsov-Ogievskiy
2018-02-15 23:02   ` Eric Blake
2018-02-16 11:09     ` Vladimir Sementsov-Ogievskiy
2018-02-16 11:45       ` Eric Blake
2018-02-16 13:21   ` Eric Blake
2018-02-16 14:43     ` Vladimir Sementsov-Ogievskiy
2018-02-16 17:01       ` Eric Blake
2018-03-01 11:36         ` Vladimir Sementsov-Ogievskiy
2018-03-02 15:07     ` Vladimir Sementsov-Ogievskiy
2018-02-15 13:51 ` Vladimir Sementsov-Ogievskiy [this message]
2018-02-16 17:35   ` [Qemu-devel] [PATCH 4/9] block/nbd-client: save first fatal error in nbd_iter_error Eric Blake
2018-02-15 13:51 ` [Qemu-devel] [PATCH 5/9] nbd/client: fix error messages in nbd_handle_reply_err Vladimir Sementsov-Ogievskiy
2018-02-16 17:38   ` Eric Blake
2018-03-01 11:38     ` Vladimir Sementsov-Ogievskiy
2018-02-15 13:51 ` [Qemu-devel] [PATCH 6/9] nbd: BLOCK_STATUS for standard get_block_status function: client part Vladimir Sementsov-Ogievskiy
2018-02-16 20:40   ` Eric Blake
2018-03-09 18:47     ` Vladimir Sementsov-Ogievskiy
2018-03-12  9:06     ` Vladimir Sementsov-Ogievskiy
2018-03-12  9:23     ` Vladimir Sementsov-Ogievskiy
2018-03-12  9:48     ` Vladimir Sementsov-Ogievskiy
2018-03-12 13:13     ` Vladimir Sementsov-Ogievskiy
2018-03-12 14:00       ` Eric Blake
2018-02-15 13:51 ` [Qemu-devel] [PATCH 7/9] iotests.py: tiny refactor: move system imports up Vladimir Sementsov-Ogievskiy
2018-02-16 20:44   ` Eric Blake
2018-03-09 18:54     ` Vladimir Sementsov-Ogievskiy
2018-02-15 13:51 ` [Qemu-devel] [PATCH 8/9] iotests: add file_path helper Vladimir Sementsov-Ogievskiy
2018-02-16 20:46   ` Eric Blake
2018-02-20  5:42     ` Jeff Cody
2018-03-12 10:04       ` Vladimir Sementsov-Ogievskiy
2018-02-15 13:51 ` [Qemu-devel] [PATCH 9/9] iotests: new test 206 for NBD BLOCK_STATUS Vladimir Sementsov-Ogievskiy
2018-02-16 21:02   ` Eric Blake
2018-03-01 11:51     ` Vladimir Sementsov-Ogievskiy
2018-03-01 18:23       ` Eric Blake
2018-02-22 19:30 ` [Qemu-devel] [PATCH 0/9] nbd block status base:allocation no-reply
2018-02-23 14:02 ` no-reply
2018-02-24  6:48 ` no-reply
2018-02-26 16:57 ` [Qemu-devel] [PATCH v2 0/2] nbd block status initial patches Eric Blake
2018-02-26 16:57   ` [Qemu-devel] [PATCH v2 1/2] nbd: BLOCK_STATUS constants Eric Blake
2018-03-01 12:06     ` Vladimir Sementsov-Ogievskiy
2018-02-26 16:57   ` [Qemu-devel] [PATCH v2 2/2] nbd/client: fix error messages in nbd_handle_reply_err Eric Blake
2018-03-01 12:10     ` Vladimir Sementsov-Ogievskiy
2018-03-01 18:25       ` Eric Blake
2018-03-09 19:08 ` [Qemu-devel] [PATCH 0/9] nbd block status base:allocation Eric Blake
2018-03-09 19:28   ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1518702707-7077-5-git-send-email-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.