summary refs log tree commit diff stats
path: root/python
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-06-10 13:07:33 +0300
committerEric Blake <eblake@redhat.com>2021-06-18 10:59:53 -0500
commitbbba1c376b8b1ba5171bd14eb6bf212fa1173ddb (patch)
tree821702398bc7634875cf8af94c48c07c87bb301c /python
parent3687ad49038e13103f7382316e16dff79abddf95 (diff)
downloadfocaccia-qemu-bbba1c376b8b1ba5171bd14eb6bf212fa1173ddb.tar.gz
focaccia-qemu-bbba1c376b8b1ba5171bd14eb6bf212fa1173ddb.zip
block/nbd: fix how state is cleared on nbd_open() failure paths
We have two "return error" paths in nbd_open() after
nbd_process_options(). Actually we should call nbd_clear_bdrvstate()
on these paths. Interesting that nbd_process_options() calls
nbd_clear_bdrvstate() by itself.

Let's fix leaks and refactor things to be more obvious:

- intialize yank at top of nbd_open()
- move yank cleanup to nbd_clear_bdrvstate()
- refactor nbd_open() so that all failure paths except for
  yank-register goes through nbd_clear_bdrvstate()

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Roman Kagan <rvkagan@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210610100802.5888-4-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions