mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
b57e4de079
commit
9b562c646b
6 changed files with 67 additions and 21 deletions
|
@ -30,4 +30,6 @@ struct BlockExport {
|
|||
const BlockExportDriver *drv;
|
||||
};
|
||||
|
||||
BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -335,7 +335,8 @@ NBDExport *nbd_export_new(BlockDriverState *bs,
|
|||
const char *name, const char *desc,
|
||||
const char *bitmap, bool readonly, bool shared,
|
||||
void (*close)(NBDExport *), bool writethrough,
|
||||
BlockBackend *on_eject_blk, Error **errp);
|
||||
Error **errp);
|
||||
void nbd_export_set_on_eject_blk(BlockExport *exp, BlockBackend *blk);
|
||||
void nbd_export_close(NBDExport *exp);
|
||||
void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
|
||||
void nbd_export_get(NBDExport *exp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue