From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0yzS-0005jV-7n for qemu-devel@nongnu.org; Tue, 06 Sep 2011 12:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0yzK-0004ZR-Kg for qemu-devel@nongnu.org; Tue, 06 Sep 2011 12:59:14 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:55984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0yzK-0004Yc-Df for qemu-devel@nongnu.org; Tue, 06 Sep 2011 12:59:06 -0400 From: Markus Armbruster Date: Tue, 6 Sep 2011 18:58:40 +0200 Message-Id: <1315328340-6192-8-git-send-email-armbru@redhat.com> In-Reply-To: <1315328340-6192-1-git-send-email-armbru@redhat.com> References: <1315328340-6192-1-git-send-email-armbru@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefano.stabellini@eu.citrix.com, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, pbonzini@redhat.com, hch@lst.de 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; } } -- 1.7.6