From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjPLR-0006hD-4u for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjPLI-0007V3-49 for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:15:09 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:38686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjPLH-0007Uv-Rx for qemu-devel@nongnu.org; Wed, 29 Oct 2014 05:15:00 -0400 Received: by mail-wi0-f169.google.com with SMTP id n3so980633wiv.4 for ; Wed, 29 Oct 2014 02:14:59 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5450B00F.6030704@redhat.com> Date: Wed, 29 Oct 2014 10:14:55 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1414569232-21357-1-git-send-email-hare@suse.de> <1414569232-21357-13-git-send-email-hare@suse.de> In-Reply-To: <1414569232-21357-13-git-send-email-hare@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: Hannes Reinecke , qemu-devel@nongnu.org Cc: Alexander Graf , Nic Bellinger , Andreas Faerber 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)? > + 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. Paolo