On 10/29/2014 10:14 AM, Paolo Bonzini wrote:


On 10/29/2014 08:53 AM, Hannes Reinecke wrote:
+
+        /*
+         * The EFI firmware doesn't handle UA,
+         * so we need to clear the Power On/Reset UA
+         * after the initial reset.
+         */
+        QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) {
+            SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child);
+            SCSISense *ua;
+
+            ua = &sdev->unit_attention;
+            *ua = SENSE_CODE(NO_SENSE);

Just sdev->unit_attention = SENSE_CODE(NO_SENSE)?

Ok.

+            sdev->sense_is_ua = false;

Setting sense_is_ua is unnecessary, it refers to dev->sense rather than
dev->unit_attention.  Just assert(dev->sense_len == 0) if you care.

You need this too:

         scsi_device_unit_attention_reported(sdev);

Otherwise the state machine that reports CD-ROM media changes gets
messed up.

yeah, this is all a bit ad-hoc. So I'll be fixing it up with the next
round.

Cheers,

Hannes


Reply via email to