qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 12/17] megasas: Clear unit attention on initial


From: Hannes Reinecke
Subject: Re: [Qemu-devel] [PATCH 12/17] megasas: Clear unit attention on initial reset
Date: Wed, 29 Oct 2014 10:53:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0

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

[Prev in Thread] Current Thread [Next in Thread]