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 <arm...@redhat.com> --- 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 544ecef..fc36327 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -74,6 +74,7 @@ struct SCSIDiskState char *version; char *serial; SCSISense sense; + bool tray_open; SCSIDriveKind drive_kind; }; @@ -826,6 +827,7 @@ static void scsi_disk_emulate_start_stop(SCSIDiskReq *r) if (s->drive_kind == SCSI_CD && loej) { bdrv_eject(s->bs, !start); + s->tray_open = !start; } } -- 1.7.2.3