qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH] scsi: Implement 'get_sense' callback


From: Hannes Reinecke
Subject: [Qemu-devel] Re: [PATCH] scsi: Implement 'get_sense' callback
Date: Tue, 23 Nov 2010 17:10:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/3.0.10 Thunderbird/3.0.10

On 11/22/2010 10:56 PM, Stefan Hajnoczi wrote:
> On Mon, Nov 22, 2010 at 10:15 AM, Hannes Reinecke <address@hidden> wrote:
>> +static int scsi_get_sense(SCSIRequest *req, uint8_t *outbuf, int len)
>> +{
>> +    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev);
>> +    int size = SCSI_SENSE_BUF_SIZE;
> 
> If there is no error we return SCSI_SENSE_BUF_SIZE without touching
> outbuf?  I was expecting a memset(outbuf, 0, ...) or something that
> initializes outbuf.
> 
If there is no error SG_ERR_DRIVER_SENSE is not set, hence there is
no sense data to fill out.
But yes, you are correct; we should be doing something sensible here.
I'll be setting it to 'NO SENSE' for initialisation.

>> +
>> +    if (s->driver_status & SG_ERR_DRIVER_SENSE) {
>> +        if (len < SCSI_SENSE_BUF_SIZE)
> 
> {}
> 
>> +            size = len;
>> +        else
> 
> {}
> 
OK, will be fixing it with the next patchset.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                   zSeries & Storage
address@hidden                        +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)



reply via email to

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