block/export: call blk_set_dev_ops(blk, NULL, NULL)pull-nbd-2023-05-03
commitde79b52604e43fdeba6cee4f5af600b62169f2d2
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 2 May 2023 21:11:19 +0000 (2 17:11 -0400)
committerEric Blake <eblake@redhat.com>
Wed, 3 May 2023 19:00:08 +0000 (3 14:00 -0500)
treee33b560b4c1e571757021af81a5f3af46775c834
parent7ade2b186d6ab6279c9f5cd85c73db047109da6e
block/export: call blk_set_dev_ops(blk, NULL, NULL)

Most export types install BlockDeviceOps pointers. It is easy to forget
to remove them because that happens automatically via the "drive" qdev
property in hw/ but not block/export/.

Put blk_set_dev_ops(blk, NULL, NULL) calls in the core export.c code so
the export types don't need to remember.

This fixes the nbd and vhost-user-blk export types.

Fixes: fd6afc501a01 ("nbd/server: Use drained block ops to quiesce the server")
Fixes: ca858a5fe94c ("vhost-user-blk-server: notify client about disk resize")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20230502211119.720647-1-stefanha@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
block/export/export.c
block/export/vduse-blk.c