On 07.09.20 20:19, Kevin Wolf wrote: > 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 <kw...@redhat.com> > --- > include/block/export.h | 2 ++ > include/block/nbd.h | 3 ++- > block/export/export.c | 13 +++++++++--- > blockdev-nbd.c | 47 +++++++++++++++++++++++++++++++++++------- > nbd/server.c | 20 +++++++++++------- > qemu-nbd.c | 3 +-- > 6 files changed, 67 insertions(+), 21 deletions(-)
[...] > + if (bdrv_is_read_only(bs)) { > + export_opts.u.nbd.has_writable = true; Ah, yes, setting that might be nice. :) Reviewed-by: Max Reitz <mre...@redhat.com>
signature.asc
Description: OpenPGP digital signature