mirror of https://github.com/xemu-project/xemu.git
scsi-disk: fix compilation with DEBUG_SCSI
Reported-by: Gerhard Wiesinger <lists@wiesinger.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
18fc611b81
commit
79fb50bb95
|
@ -447,7 +447,7 @@ static void scsi_write_complete(void * opaque, int ret)
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
|
scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
|
||||||
DPRINTF("Write complete tag=0x%x more=%d\n", r->req.tag, r->qiov.size);
|
DPRINTF("Write complete tag=0x%x more=%zd\n", r->req.tag, r->qiov.size);
|
||||||
scsi_req_data(&r->req, r->qiov.size);
|
scsi_req_data(&r->req, r->qiov.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1277,7 +1277,7 @@ static void scsi_disk_emulate_read_data(SCSIRequest *req)
|
||||||
int buflen = r->iov.iov_len;
|
int buflen = r->iov.iov_len;
|
||||||
|
|
||||||
if (buflen) {
|
if (buflen) {
|
||||||
DPRINTF("Read buf_len=%zd\n", buflen);
|
DPRINTF("Read buf_len=%d\n", buflen);
|
||||||
r->iov.iov_len = 0;
|
r->iov.iov_len = 0;
|
||||||
r->started = true;
|
r->started = true;
|
||||||
scsi_req_data(&r->req, buflen);
|
scsi_req_data(&r->req, buflen);
|
||||||
|
@ -1455,7 +1455,7 @@ static void scsi_disk_emulate_write_data(SCSIRequest *req)
|
||||||
|
|
||||||
if (r->iov.iov_len) {
|
if (r->iov.iov_len) {
|
||||||
int buflen = r->iov.iov_len;
|
int buflen = r->iov.iov_len;
|
||||||
DPRINTF("Write buf_len=%zd\n", buflen);
|
DPRINTF("Write buf_len=%d\n", buflen);
|
||||||
r->iov.iov_len = 0;
|
r->iov.iov_len = 0;
|
||||||
scsi_req_data(&r->req, buflen);
|
scsi_req_data(&r->req, buflen);
|
||||||
return;
|
return;
|
||||||
|
@ -2093,23 +2093,24 @@ static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
|
||||||
const SCSIReqOps *ops;
|
const SCSIReqOps *ops;
|
||||||
uint8_t command;
|
uint8_t command;
|
||||||
|
|
||||||
#ifdef DEBUG_SCSI
|
|
||||||
DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, buf[0]);
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 1; i < r->req.cmd.len; i++) {
|
|
||||||
printf(" 0x%02x", buf[i]);
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
command = buf[0];
|
command = buf[0];
|
||||||
ops = scsi_disk_reqops_dispatch[command];
|
ops = scsi_disk_reqops_dispatch[command];
|
||||||
if (!ops) {
|
if (!ops) {
|
||||||
ops = &scsi_disk_emulate_reqops;
|
ops = &scsi_disk_emulate_reqops;
|
||||||
}
|
}
|
||||||
req = scsi_req_alloc(ops, &s->qdev, tag, lun, hba_private);
|
req = scsi_req_alloc(ops, &s->qdev, tag, lun, hba_private);
|
||||||
|
|
||||||
|
#ifdef DEBUG_SCSI
|
||||||
|
DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]);
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 1; i < req->cmd.len; i++) {
|
||||||
|
printf(" 0x%02x", buf[i]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue