Skip to content
  • Hanna Reitz's avatar
    12c7ec87
    blockdev: Fix 'change' for slot devices · 12c7ec87
    Hanna Reitz authored
    
    
    'change' and related operations did not work when used on guest devices
    featuring removable media but no actual tray, because
    blk_dev_is_tray_open() always returned false for them and the
    blockdev-{insert,remove}-medium commands required it to return true.
    
    Fix this by making blockdev-{insert,remove}-medium work on tray-less
    devices. Also, blockdev-{open,close}-tray are now explicitly no-ops when
    invoked on such devices, and blk_dev_change_media_cb() is instead
    called by blockdev-{insert,remove}-medium (for tray-less devices only).
    
    Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Cc: qemu-stable <qemu-stable@nongnu.org>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
    Message-id: 1454096953-31773-3-git-send-email-mreitz@redhat.com
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    12c7ec87
    blockdev: Fix 'change' for slot devices
    Hanna Reitz authored
    
    
    'change' and related operations did not work when used on guest devices
    featuring removable media but no actual tray, because
    blk_dev_is_tray_open() always returned false for them and the
    blockdev-{insert,remove}-medium commands required it to return true.
    
    Fix this by making blockdev-{insert,remove}-medium work on tray-less
    devices. Also, blockdev-{open,close}-tray are now explicitly no-ops when
    invoked on such devices, and blk_dev_change_media_cb() is instead
    called by blockdev-{insert,remove}-medium (for tray-less devices only).
    
    Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Cc: qemu-stable <qemu-stable@nongnu.org>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
    Message-id: 1454096953-31773-3-git-send-email-mreitz@redhat.com
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Loading