diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-07-16 14:18:58 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-07-27 08:25:25 +0200 |
commit | e48e84ea80cb2e7fe6e48196ce187cfba6e3eb2c (patch) | |
tree | 9ca4997e8d067b51940b9dba3ce6e9adc0781dc5 /hw/scsi-disk.c | |
parent | 350e6e419902991b073b313aa65b240d1024d57e (diff) |
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>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index b52e30448a..734fe13c65 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -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)); } } |