From a693437037328a95d815ad5aec37ac2f8e130e58 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Wed, 20 Sep 2017 15:45:07 +0300 Subject: block/nbd-client: nbd_co_send_request: fix return code It's incorrect to return success rc >= 0 if we skip qio_channel_writev_all() call due to s->quit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id: <20170920124507.18841-4-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake --- block/nbd-client.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block/nbd-client.c') diff --git a/block/nbd-client.c b/block/nbd-client.c index ac93c4c0d0..72651dcdb1 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -161,6 +161,8 @@ static int nbd_co_send_request(BlockDriverState *bs, NULL) < 0) { rc = -EIO; } + } else if (rc >= 0) { + rc = -EIO; } qio_channel_set_cork(s->ioc, false); } else { -- cgit v1.2.3