From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1CCF-0001Wz-Lr for qemu-devel@nongnu.org; Wed, 07 Sep 2011 03:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1CCE-0003F0-Dq for qemu-devel@nongnu.org; Wed, 07 Sep 2011 03:05:19 -0400 Received: from mail-vw0-f53.google.com ([209.85.212.53]:47066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1CCE-00038z-8b for qemu-devel@nongnu.org; Wed, 07 Sep 2011 03:05:18 -0400 Received: by mail-vw0-f53.google.com with SMTP id 13so6045123vws.12 for ; Wed, 07 Sep 2011 00:05:18 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E6717A9.8060100@redhat.com> Date: Wed, 07 Sep 2011 09:05:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1315328340-6192-1-git-send-email-armbru@redhat.com> <1315328340-6192-8-git-send-email-armbru@redhat.com> In-Reply-To: <1315328340-6192-8-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 07/27] scsi-disk: Track tray open/close state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de On 09/06/2011 06:58 PM, Markus Armbruster wrote: > We already track it in BlockDriverState since commit 4be9762a. As > discussed in that commit's message, we should track it in the device > device models instead, because it's device state. > > Signed-off-by: Markus Armbruster > --- > hw/scsi-disk.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c > index c8ad2e7..f18ddd7 100644 > --- a/hw/scsi-disk.c > +++ b/hw/scsi-disk.c > @@ -72,6 +72,7 @@ struct SCSIDiskState > QEMUBH *bh; > char *version; > char *serial; > + bool tray_open; > }; > > static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type); > @@ -823,6 +824,7 @@ static void scsi_disk_emulate_start_stop(SCSIDiskReq *r) > > if (s->qdev.type == TYPE_ROM&& loej) { > bdrv_eject(s->bs, !start); > + s->tray_open = !start; > } > } > Reviewed-by: Paolo Bonzini