From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzRHx-0005uo-0i for qemu-devel@nongnu.org; Fri, 02 Sep 2011 06:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzRHw-0004aB-57 for qemu-devel@nongnu.org; Fri, 02 Sep 2011 06:47:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzRHv-0004Zw-UO for qemu-devel@nongnu.org; Fri, 02 Sep 2011 06:47:56 -0400 Message-ID: <4E60AF43.5050204@redhat.com> Date: Fri, 02 Sep 2011 12:26:11 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1312376904-16115-1-git-send-email-armbru@redhat.com> <1312376904-16115-12-git-send-email-armbru@redhat.com> In-Reply-To: <1312376904-16115-12-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 11/45] scsi-disk: Factor out scsi_disk_emulate_start_stop() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: quintela@redhat.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de Am 03.08.2011 15:07, schrieb Markus Armbruster: > Signed-off-by: Markus Armbruster > --- > hw/scsi-disk.c | 17 +++++++++++++---- > 1 files changed, 13 insertions(+), 4 deletions(-) > > diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c > index fa198f9..d549cb7 100644 > --- a/hw/scsi-disk.c > +++ b/hw/scsi-disk.c > @@ -820,6 +820,18 @@ static int scsi_disk_emulate_read_toc(SCSIRequest *req, uint8_t *outbuf) > return toclen; > } > > +static void scsi_disk_emulate_start_stop(SCSIDiskReq *r) > +{ > + SCSIRequest *req = &r->req; > + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); > + bool start = req->cmd.buf[4] & 1; > + bool loej = req->cmd.buf[4] & 2; > + > + if (s->qdev.type == TYPE_ROM && loej) { > + bdrv_eject(s->bs, !start); > + } > +} > + > static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf) > { > SCSIRequest *req = &r->req; > @@ -873,10 +885,7 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf) > goto illegal_request; > break; > case START_STOP: > - if (s->qdev.type == TYPE_ROM && (req->cmd.buf[4] & 2)) { > - /* load/eject medium */ So here we actually had the comment before. Can we retain it? Kevin