summaryrefslogtreecommitdiffstats
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorKevin Wolf2020-09-24 17:26:53 +0200
committerKevin Wolf2020-10-02 15:46:40 +0200
commit9b562c646bc0ad5fca3cfa00720e431c7e72769a (patch)
tree59134ba5b6a31c3058328a7ddbf2540a8373c6e9 /qemu-nbd.c
parentqemu-nbd: Use raw block driver for --offset (diff)
downloadqemu-9b562c646bc0ad5fca3cfa00720e431c7e72769a.tar.gz
qemu-9b562c646bc0ad5fca3cfa00720e431c7e72769a.tar.xz
qemu-9b562c646bc0ad5fca3cfa00720e431c7e72769a.zip
block/export: Remove magic from block-export-add
nbd-server-add tries to be convenient and adds two questionable features that we don't want to share in block-export-add, even for NBD exports: 1. When requesting a writable export of a read-only device, the export is silently downgraded to read-only. This should be an error in the context of block-export-add. 2. When using a BlockBackend name, unplugging the device from the guest will automatically stop the NBD server, too. This may sometimes be what you want, but it could also be very surprising. Let's keep things explicit with block-export-add. If the user wants to stop the export, they should tell us so. Move these things into the nbd-server-add QMP command handler so that they apply only there. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200924152717.287415-8-kwolf@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 16473d809c..b2a0ea6c5e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -1067,8 +1067,7 @@ int main(int argc, char **argv)
export = nbd_export_new(bs, export_name,
export_description, bitmap, readonly, shared > 1,
- nbd_export_closed, writethrough, NULL,
- &error_fatal);
+ nbd_export_closed, writethrough, &error_fatal);
if (device) {
#if HAVE_NBD_DEVICE