From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjPwq-0006gM-4h for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjPwi-0002cA-LH for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:53:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59402 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjPwi-0002by-FD for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:53:40 -0400 Message-ID: <5450B904.7050908@suse.de> Date: Wed, 29 Oct 2014 10:53:08 +0100 From: Hannes Reinecke MIME-Version: 1.0 References: <1414569232-21357-1-git-send-email-hare@suse.de> <1414569232-21357-13-git-send-email-hare@suse.de> <5450B00F.6030704@redhat.com> In-Reply-To: <5450B00F.6030704@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/17] megasas: Clear unit attention on initial reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: Andreas Faerber , Alexander Graf 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