qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Gleb Natapov <gleb@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu list <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] cdrom: Allow the TEST_UNIT_READY	command after a cdrom change
Date: Fri, 8 Apr 2011 15:45:42 -0500	[thread overview]
Message-ID: <20110408204542.GA7163@us.ibm.com> (raw)
In-Reply-To: <abe9b73c240a97c42bf68f5cf371a62ec198e8c3.1302165882.git.amit.shah@redhat.com>

* Amit Shah <amit.shah@redhat.com> [2011-04-07 03:53]:
> We restrict the commands that a guest can send us after a cdrom change
> event.  The current list includes REQUEST_SENSE and INQUIRY commands.
> Guests can also issue TEST_UNIT_READY to inquire for the status, so
> allow this command as well.
> 
> This also gets rid of one cause of the HSM violation errors in Linux
> guests.  Those errors came up because we had the UNIT_ATTENTION event
> pending and we replied with an error message to a command that should be
> allowed in such a condition.  The guest then did a soft reset to get to
> a sane state.
> 
> Signed-off-by: Amit Shah <amit.shah@redhat.com>
> ---
>  hw/ide/core.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 007a4ee..d55d804 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -1105,10 +1105,11 @@ static void ide_atapi_cmd(IDEState *s)
>      /* If there's a UNIT_ATTENTION condition pending, only
>         REQUEST_SENSE and INQUIRY commands are allowed to complete. */

Wasn't this comment going to get updated to be more generic (ie more
than just the 3 commands below may be needed?)

>      if (s->sense_key == SENSE_UNIT_ATTENTION &&
> -	s->io_buffer[0] != GPCMD_REQUEST_SENSE &&
> -	s->io_buffer[0] != GPCMD_INQUIRY) {
> -	ide_atapi_cmd_check_status(s);
> -	return;
> +        s->io_buffer[0] != GPCMD_REQUEST_SENSE &&
> +        s->io_buffer[0] != GPCMD_INQUIRY &&
> +        s->io_buffer[0] != GPCMD_TEST_UNIT_READY) {
> +        ide_atapi_cmd_check_status(s);
> +        return;
>      }
>      switch(s->io_buffer[0]) {
>      case GPCMD_TEST_UNIT_READY:
> -- 
> 1.7.4
> 

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

  reply	other threads:[~2011-04-08 20:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  8:46 [Qemu-devel] [PATCH v3 0/2] Correct transitions for cd change state Amit Shah
2011-04-07  8:46 ` [Qemu-devel] [PATCH v3 1/2] cdrom: Allow the TEST_UNIT_READY command after a cdrom change Amit Shah
2011-04-08 20:45   ` Ryan Harper [this message]
2011-04-07  8:46 ` [Qemu-devel] [PATCH v3 2/2] cdrom: Make disc change event visible to guests Amit Shah
2011-04-07  9:25 ` [Qemu-devel] Re: [PATCH v3 0/2] Correct transitions for cd change state Stefan Hajnoczi
2011-04-07  9:26 ` Paolo Bonzini

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=20110408204542.GA7163@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@gmail.com \
    /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).