nbd: assert that Error** is not NULL in nbd_iter_channel_errorpull-error-2019-12-16
commit0e7f83bab6559775cd71e418b12a49145e59faa7
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 5 Dec 2019 17:46:35 +0000 (5 20:46 +0300)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 16 Dec 2019 19:50:16 +0000 (16 20:50 +0100)
tree4ca9051a90bf4b086159310962a9de23335d6faa
parentf4ad072ccc27442f9bf8f4fd6f4732fbc35f757c
nbd: assert that Error** is not NULL in nbd_iter_channel_error

All callers of nbd_iter_channel_error() pass the address of a
local_err variable, and only call this function if an error has
already occurred, using this function to propagate that error.
This is already implied by its name (local_err instead of the classic
errp), but it is worth additionally stressing this by adding an
assertion to make it part of the function contract.

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 <vsementsov@virtuozzo.com>
Message-Id: <20191205174635.18758-22-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
block/nbd.c