From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QseYP-0005hg-Cn for qemu-devel@nongnu.org; Sun, 14 Aug 2011 13:32:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QseYO-00006W-4h for qemu-devel@nongnu.org; Sun, 14 Aug 2011 13:32:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QseYN-00006Q-Tt for qemu-devel@nongnu.org; Sun, 14 Aug 2011 13:32:52 -0400 Message-ID: <4E4806BD.5010309@redhat.com> Date: Sun, 14 Aug 2011 19:32:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1313167776-27926-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/scsi-bus.c: Fix use of uninitialised variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Peter Maydell , The OpenBIOS Mailinglist , qemu-devel@nongnu.org On 08/13/2011 07:29 PM, Blue Swirl wrote: > On Fri, Aug 12, 2011 at 7:22 PM, Blue Swirl wrote: >> On Fri, Aug 12, 2011 at 4:49 PM, Peter Maydell wrote: >>> Don't use req before it has been initialised in scsi_req_new(). >>> This fixes a compile failure due to gcc complaining about this. >> >> It fixes a crash if the warning is ignored: >> Configuration device id QEMU version 1 machine id 32 Please apply it. > This is due to division by zero in OpenBIOS drivers/esp.c. Bisecting > reveals that this is due to c7b488721d6aafe32994ac63f8d690ae6d4729fa, > SCSI devices now report Unit Attention status after reset. OpenBIOS > does not handle this case and fails (block size is 0). > > First OpenBIOS issues Inquiry command, then if a device is present, > Read Capacity. I tried adding Request Sense command after Inquiry, but > then QEMU crashes: Thanks, I'll look into this. However, not that Inquiry will not report unit attention. The right fix is to send a Test Unit Ready after Inquiry and until it passes (and fail after 3/4 tries). Paolo