diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-24 09:45:22 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-24 09:45:22 -0600 |
commit | 7c1daf341f3374a490a03dfcde17021d3369aa48 (patch) | |
tree | f45381088a6d7fad7778ffd5cef6602f0aa3d640 /hw/ide/atapi.c | |
parent | 5105b6d88d1958de8c12672fba7e30a0b0f38653 (diff) | |
parent | 6f382ed226f3a408825d882e6c4b47499baaa15b (diff) |
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp:
qmp: add DEVICE_TRAY_MOVED event
ide: drop ide_tray_state_post_load()
block: Don't call bdrv_eject() if the tray state didn't change
block: bdrv_eject(): Make eject_flag a real bool
block: Rename bdrv_mon_event() & BlockMonEventAction
Diffstat (limited to 'hw/ide/atapi.c')
-rw-r--r-- | hw/ide/atapi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 0adb27b799..5919cf52d8 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -883,8 +883,11 @@ static void cmd_start_stop_unit(IDEState *s, uint8_t* buf) ide_atapi_cmd_error(s, sense, ASC_MEDIA_REMOVAL_PREVENTED); return; } - bdrv_eject(s->bs, !start); - s->tray_open = !start; + + if (s->tray_open != !start) { + bdrv_eject(s->bs, !start); + s->tray_open = !start; + } } ide_atapi_cmd_ok(s); |