mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 05:13:54 -06:00
scsi: establish precedence levels for unit attention
When a device is resized, we will report a unit attention condition for CAPACITY DATA HAS CHANGED. However, we should ensure that this condition does not override a more important unit attention condition. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
350e6e4199
commit
e48e84ea80
4 changed files with 55 additions and 3 deletions
|
@ -1876,7 +1876,7 @@ static void scsi_cd_change_media_cb(void *opaque, bool load)
|
|||
*/
|
||||
s->media_changed = load;
|
||||
s->tray_open = !load;
|
||||
s->qdev.unit_attention = SENSE_CODE(UNIT_ATTENTION_NO_MEDIUM);
|
||||
scsi_device_set_ua(&s->qdev, SENSE_CODE(UNIT_ATTENTION_NO_MEDIUM));
|
||||
s->media_event = true;
|
||||
s->eject_request = false;
|
||||
}
|
||||
|
@ -1913,7 +1913,7 @@ static void scsi_disk_unit_attention_reported(SCSIDevice *dev)
|
|||
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
|
||||
if (s->media_changed) {
|
||||
s->media_changed = false;
|
||||
s->qdev.unit_attention = SENSE_CODE(MEDIUM_CHANGED);
|
||||
scsi_device_set_ua(&s->qdev, SENSE_CODE(MEDIUM_CHANGED));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue