Skip to content
Snippets Groups Projects
  • Kevin Wolf's avatar
    9b562c64
    block/export: Remove magic from block-export-add · 9b562c64
    Kevin Wolf authored
    
    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: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-Id: <20200924152717.287415-8-kwolf@redhat.com>
    Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    9b562c64
    History
    block/export: Remove magic from block-export-add
    Kevin Wolf authored
    
    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: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-Id: <20200924152717.287415-8-kwolf@redhat.com>
    Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>