qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] hw/scsi-bus.c: Fix use of uninitialised variable
Date: Sun, 14 Aug 2011 19:32:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 08/13/2011 07:29 PM, Blue Swirl wrote:
On Fri, Aug 12, 2011 at 7:22 PM, Blue Swirl<address@hidden>  wrote:
On Fri, Aug 12, 2011 at 4:49 PM, Peter Maydell<address@hidden>  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



reply via email to

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