mirror of https://github.com/xqemu/xqemu.git
scsi-disk: Track tray open/close state
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>
This commit is contained in:
parent
bfd52647ad
commit
ece0d5e9a7
|
@ -72,6 +72,7 @@ struct SCSIDiskState
|
||||||
QEMUBH *bh;
|
QEMUBH *bh;
|
||||||
char *version;
|
char *version;
|
||||||
char *serial;
|
char *serial;
|
||||||
|
bool tray_open;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type);
|
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) {
|
if (s->qdev.type == TYPE_ROM && loej) {
|
||||||
bdrv_eject(s->bs, !start);
|
bdrv_eject(s->bs, !start);
|
||||||
|
s->tray_open = !start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue