From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49728 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7jYT-0005oC-1V for qemu-devel@nongnu.org; Thu, 07 Apr 2011 03:23:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7jYQ-0002Z4-0R for qemu-devel@nongnu.org; Thu, 07 Apr 2011 03:23:00 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:64019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7jYP-0002Yj-Rb for qemu-devel@nongnu.org; Thu, 07 Apr 2011 03:22:57 -0400 Received: by qwj8 with SMTP id 8so1562252qwj.4 for ; Thu, 07 Apr 2011 00:22:57 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4D9D664C.40807@redhat.com> Date: Thu, 07 Apr 2011 09:22:52 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2 1/2] cdrom: Allow the TEST_UNIT_READY command after a cdrom change List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Kevin Wolf , Gleb Natapov , Juan Quintela , Stefan Hajnoczi , Markus Armbruster , qemu list On 04/07/2011 07:05 AM, Amit Shah wrote: > 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. > > Signed-off-by: Amit Shah > --- > 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. */ > 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: ACK Paolo