Il 04/12/2013 05:55, Alexey Kardashevskiy ha scritto:
> This prevents the guest from preventing DVD medium removal when
> there is no medium.
> 
> Without this, if the user has ejected a DVD, it is possible to
> have a block device with an open tray, no media but locked.

This state is weird but should not be a problem.  The tray can
still be closed when it is open and locked:

        if (!start && !s->tray_open && s->tray_locked) {
            scsi_check_condition(r,
                                 bdrv_is_inserted(s->qdev.conf.bs)
                                 ? SENSE_CODE(ILLEGAL_REQ_REMOVAL_PREVENTED)
                                 : SENSE_CODE(NOT_READY_REMOVAL_PREVENTED));
            return -1;
        }

Note that start && s->tray_open && s->tray_locked executes the
command normally, closing the tray and reporting that as a QMP
event.

Paolo

> Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru>
> ---
>  hw/scsi/scsi-disk.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 08b6135..22b6859 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -1622,7 +1622,6 @@ static int32_t scsi_disk_emulate_command(SCSIRequest 
> *req, uint8_t *buf)
>      case RELEASE:
>      case RELEASE_10:
>      case START_STOP:
> -    case ALLOW_MEDIUM_REMOVAL:
>      case GET_CONFIGURATION:
>      case GET_EVENT_STATUS_NOTIFICATION:
>      case MECHANISM_STATUS:
> 


Reply via email to