scsi-disk: Codingstyle fixes
Replace tabs with spaces. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
efc8243d00
commit
5f71d32f0d
@ -526,7 +526,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
|
|||||||
memset(outbuf, 0, buflen);
|
memset(outbuf, 0, buflen);
|
||||||
|
|
||||||
if (req->lun) {
|
if (req->lun) {
|
||||||
outbuf[0] = 0x7f; /* LUN not supported */
|
outbuf[0] = 0x7f; /* LUN not supported */
|
||||||
return buflen;
|
return buflen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -836,7 +836,7 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
|
|||||||
case TEST_UNIT_READY:
|
case TEST_UNIT_READY:
|
||||||
if (!bdrv_is_inserted(s->bs))
|
if (!bdrv_is_inserted(s->bs))
|
||||||
goto not_ready;
|
goto not_ready;
|
||||||
break;
|
break;
|
||||||
case REQUEST_SENSE:
|
case REQUEST_SENSE:
|
||||||
if (req->cmd.xfer < 4)
|
if (req->cmd.xfer < 4)
|
||||||
goto illegal_request;
|
goto illegal_request;
|
||||||
@ -848,7 +848,7 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
|
|||||||
buflen = scsi_disk_emulate_inquiry(req, outbuf);
|
buflen = scsi_disk_emulate_inquiry(req, outbuf);
|
||||||
if (buflen < 0)
|
if (buflen < 0)
|
||||||
goto illegal_request;
|
goto illegal_request;
|
||||||
break;
|
break;
|
||||||
case MODE_SENSE:
|
case MODE_SENSE:
|
||||||
case MODE_SENSE_10:
|
case MODE_SENSE_10:
|
||||||
buflen = scsi_disk_emulate_mode_sense(req, outbuf);
|
buflen = scsi_disk_emulate_mode_sense(req, outbuf);
|
||||||
@ -881,14 +881,14 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
|
|||||||
/* load/eject medium */
|
/* load/eject medium */
|
||||||
bdrv_eject(s->bs, !(req->cmd.buf[4] & 1));
|
bdrv_eject(s->bs, !(req->cmd.buf[4] & 1));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ALLOW_MEDIUM_REMOVAL:
|
case ALLOW_MEDIUM_REMOVAL:
|
||||||
bdrv_set_locked(s->bs, req->cmd.buf[4] & 1);
|
bdrv_set_locked(s->bs, req->cmd.buf[4] & 1);
|
||||||
break;
|
break;
|
||||||
case READ_CAPACITY:
|
case READ_CAPACITY:
|
||||||
/* The normal LEN field for this command is zero. */
|
/* The normal LEN field for this command is zero. */
|
||||||
memset(outbuf, 0, 8);
|
memset(outbuf, 0, 8);
|
||||||
bdrv_get_geometry(s->bs, &nb_sectors);
|
bdrv_get_geometry(s->bs, &nb_sectors);
|
||||||
if (!nb_sectors)
|
if (!nb_sectors)
|
||||||
goto not_ready;
|
goto not_ready;
|
||||||
nb_sectors /= s->cluster_size;
|
nb_sectors /= s->cluster_size;
|
||||||
@ -908,7 +908,7 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
|
|||||||
outbuf[6] = s->cluster_size * 2;
|
outbuf[6] = s->cluster_size * 2;
|
||||||
outbuf[7] = 0;
|
outbuf[7] = 0;
|
||||||
buflen = 8;
|
buflen = 8;
|
||||||
break;
|
break;
|
||||||
case SYNCHRONIZE_CACHE:
|
case SYNCHRONIZE_CACHE:
|
||||||
ret = bdrv_flush(s->bs);
|
ret = bdrv_flush(s->bs);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user