[OpenBIOS] [Qemu-devel] [PATCH] hw/scsi-bus.c: Fix use of uninitialised variable

Paolo Bonzini pbonzini at redhat.com
Sun Aug 14 19:32:45 CEST 2011


On 08/13/2011 07:29 PM, Blue Swirl wrote:
> On Fri, Aug 12, 2011 at 7:22 PM, Blue Swirl<blauwirbel at gmail.com>  wrote:
>> On Fri, Aug 12, 2011 at 4:49 PM, Peter Maydell<peter.maydell at linaro.org>  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



More information about the OpenBIOS mailing list