From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51708 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7kwW-0005fS-8m for qemu-devel@nongnu.org; Thu, 07 Apr 2011 04:51:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7kwU-0005ui-VI for qemu-devel@nongnu.org; Thu, 07 Apr 2011 04:51:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7kwU-0005uX-Mr for qemu-devel@nongnu.org; Thu, 07 Apr 2011 04:51:54 -0400 Date: Thu, 7 Apr 2011 14:21:48 +0530 From: Amit Shah Message-ID: <20110407085147.GB11546@amit-x200.redhat.com> References: <20110407084109.GA21709@stefanha-thinkpad.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110407084109.GA21709@stefanha-thinkpad.localdomain> Subject: [Qemu-devel] Re: [PATCH v2 2/2] cdrom: Make disc change event visible to guests List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Gleb Natapov , Juan Quintela , Markus Armbruster , qemu list On (Thu) 07 Apr 2011 [09:41:09], Stefan Hajnoczi wrote: > On Thu, Apr 07, 2011 at 10:35:19AM +0530, Amit Shah wrote: > > + /* > > + * First, check if there's any pending media change > > + * notification to be given. > > + * > > + * We want the guest to notice an empty tray between a cd > > + * change, so send one MEDIUM_NOT_PRESENT message after a > > + * cd change. > > + * > > + * After we've sent that message, the guest will poke at > > + * us again and send the UNIT_ATTENTION message then. > > + * Once this is done, reset the UNIT_ATTENTION message to > > + * ensure we don't keep repeating it. > > + */ > > Indentation is off here. Fixed in v3. > > + if (!s->media_change_notified) { > > + ide_atapi_cmd_error(s, SENSE_NOT_READY, > > + ASC_MEDIUM_NOT_PRESENT); > > + s->media_change_notified = 1; > > + } else if (s->cdrom_changed) { > > + s->sense_key = SENSE_UNIT_ATTENTION; > > + s->asc = ASC_MEDIUM_MAY_HAVE_CHANGED; > > + ide_atapi_cmd_ok(s); > > + > > + s->cdrom_changed = 0; > > + sense = SENSE_NONE; > > Indentation is off here. > > Otherwise looks good. I will test a Windows 2003 Server guest. Thanks; I tested Win XP and RHEL6 guests. Amit