From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] scsi-disk: check for meduim on ALLOW_MEDIUM_REMOVAL
Date: Wed, 04 Dec 2013 18:34:10 +0100 [thread overview]
Message-ID: <529F6792.3020605@redhat.com> (raw)
In-Reply-To: <1386132925-16728-3-git-send-email-aik@ozlabs.ru>
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 <aik@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:
>
next prev parent reply other threads:[~2013-12-04 17:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-04 4:55 [Qemu-devel] [PATCH 0/3] scsi: eject fixed Alexey Kardashevskiy
2013-12-04 4:55 ` [Qemu-devel] [PATCH 1/3] scsi-disk: close drive on START_STOP Alexey Kardashevskiy
2013-12-04 8:58 ` Paolo Bonzini
2013-12-04 9:33 ` Markus Armbruster
2013-12-04 11:59 ` Alexey Kardashevskiy
2013-12-04 13:12 ` Markus Armbruster
2013-12-04 23:08 ` Alexey Kardashevskiy
2013-12-05 8:01 ` Markus Armbruster
2013-12-05 12:29 ` Markus Armbruster
2013-12-05 12:42 ` Alexey Kardashevskiy
2013-12-05 12:49 ` Paolo Bonzini
2013-12-06 11:18 ` Markus Armbruster
2013-12-04 4:55 ` [Qemu-devel] [PATCH 2/3] scsi-disk: check for meduim on ALLOW_MEDIUM_REMOVAL Alexey Kardashevskiy
2013-12-04 9:03 ` Paolo Bonzini
2013-12-04 9:35 ` Markus Armbruster
2013-12-04 12:03 ` Alexey Kardashevskiy
2013-12-04 12:51 ` Markus Armbruster
2013-12-04 17:34 ` Paolo Bonzini [this message]
2013-12-04 4:55 ` [Qemu-devel] [PATCH 3/3] scsi debug: print command name in debug Alexey Kardashevskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=529F6792.3020605@redhat.com \
--to=pbonzini@redhat.com \
--cc=aik@ozlabs.ru \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).