virtio-blk: Fix rollback path in virtio_blk_data_plane_start()
commit570fe439e5d1b8626cf344c6bc97d90cfcaf0c79
authorGreg Kurz <groug@kaod.org>
Wed, 7 Apr 2021 14:34:58 +0000 (7 16:34 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 May 2021 14:26:18 +0000 (14 10:26 -0400)
tree74766593863f2dbe7dc62286a8426a7bed345549
parent8a49487c654a6150615d758e0816314b00cb481e
virtio-blk: Fix rollback path in virtio_blk_data_plane_start()

When dataplane multiqueue support was added in QEMU 2.7, the path
that would rollback guest notifiers assignment in case of error
simply got dropped.

Later on, when Error was added to blk_set_aio_context() in QEMU 4.1,
another error path was introduced, but it ommits to rollback both
host and guest notifiers.

It seems cleaner to fix the rollback path in one go. The patch is
simple enough that it can be adjusted if backported to a pre-4.1
QEMU.

Fixes: 51b04ac5c6a6 ("virtio-blk: dataplane multiqueue support")
Cc: stefanha@redhat.com
Fixes: 97896a4887a0 ("block: Add Error to blk_set_aio_context()")
Cc: kwolf@redhat.com
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210407143501.244343-2-groug@kaod.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/block/dataplane/virtio-blk.c