scsi-disk: restruct emulation: VERIFY
Move VERIFY emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
39ec9a504d
commit
88f8a5ed0f
|
@ -794,6 +794,8 @@ static int scsi_disk_emulate_command(SCSIRequest *req, uint8_t *outbuf)
|
||||||
outbuf[3] = 8;
|
outbuf[3] = 8;
|
||||||
buflen = 16;
|
buflen = 16;
|
||||||
break;
|
break;
|
||||||
|
case VERIFY:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
goto illegal_request;
|
goto illegal_request;
|
||||||
}
|
}
|
||||||
|
@ -912,6 +914,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
|
||||||
case GET_CONFIGURATION:
|
case GET_CONFIGURATION:
|
||||||
case SERVICE_ACTION_IN:
|
case SERVICE_ACTION_IN:
|
||||||
case REPORT_LUNS:
|
case REPORT_LUNS:
|
||||||
|
case VERIFY:
|
||||||
rc = scsi_disk_emulate_command(&r->req, outbuf);
|
rc = scsi_disk_emulate_command(&r->req, outbuf);
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
r->iov.iov_len = rc;
|
r->iov.iov_len = rc;
|
||||||
|
@ -940,9 +943,6 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
|
||||||
r->sector_count = len * s->cluster_size;
|
r->sector_count = len * s->cluster_size;
|
||||||
is_write = 1;
|
is_write = 1;
|
||||||
break;
|
break;
|
||||||
case VERIFY:
|
|
||||||
DPRINTF("Verify (sector %" PRId64 ", count %d)\n", lba, len);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
DPRINTF("Unknown SCSI command (%2.2x)\n", buf[0]);
|
DPRINTF("Unknown SCSI command (%2.2x)\n", buf[0]);
|
||||||
fail:
|
fail:
|
||||||
|
|
Loading…
Reference in a new issue