Received: from [140.186.70.92] (port=52020 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q89Kw-0002K7-Pa for qemu-devel@nongnu.org; Fri, 08 Apr 2011 06:54:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q89Kv-0007Fu-Lr for qemu-devel@nongnu.org; Fri, 08 Apr 2011 06:54:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q89Kv-0007FN-9s for qemu-devel@nongnu.org; Fri, 08 Apr 2011 06:54:45 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 1/5] atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change References: <7dad199c525d4b2079658b090b210472f433e1c9.1302246567.git.amit.shah@redhat.com> Date: Fri, 08 Apr 2011 12:54:40 +0200 In-Reply-To: <7dad199c525d4b2079658b090b210472f433e1c9.1302246567.git.amit.shah@redhat.com> (Amit Shah's message of "Fri, 8 Apr 2011 12:45:15 +0530") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Kevin Wolf , Stefan Hajnoczi , Paolo Bonzini , qemu list , Juan Quintela Amit Shah writes: > After a media change, the only commands allowed from the guest were > REQUEST_SENSE and INQUIRY. The guest may also issue > GET_EVENT_STATUS_NOTIFICATION commands to get media > changed notification. > > After this, the HSM violation messages from Linux guests aren't seen. > > 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 c11d457..327f703 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. */ Comment is now stale. I doubt it's terribly useful for anyone capable of reading C, but as long as it's there, it better be accurate. > 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_GET_EVENT_STATUS_NOTIFICATION) { > + ide_atapi_cmd_check_status(s); > + return; > } > switch(s->io_buffer[0]) { > case GPCMD_TEST_UNIT_READY: