]> git.proxmox.com Git - qemu.git/commitdiff
scsi-disk: Track tray open/close state
authorMarkus Armbruster <armbru@redhat.com>
Tue, 6 Sep 2011 16:58:40 +0000 (18:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 12 Sep 2011 13:17:20 +0000 (15:17 +0200)
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 <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/scsi-disk.c

index c8ad2e7d03e526ab2f83687e333fac2f57ca5c58..f18ddd742a9520404e9d8614f75d105383c6a310 100644 (file)
@@ -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;
     }
 }