[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] scsi: Implement 'get_sense' callback
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] Re: [PATCH] scsi: Implement 'get_sense' callback |
Date: |
Mon, 22 Nov 2010 21:56:47 +0000 |
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 (s->driver_status & SG_ERR_DRIVER_SENSE) {
> + if (len < SCSI_SENSE_BUF_SIZE)
{}
> + size = len;
> + else
{}
Stefan