[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/25] scsi: fix and improve debug prints
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 17/25] scsi: fix and improve debug prints |
Date: |
Wed, 8 Sep 2010 15:29:34 +0200 |
From: Bernhard Kohl <address@hidden>
Some of them are not compile clean.
Signed-off-by: Bernhard Kohl <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/lsi53c895a.c | 4 ++--
hw/scsi-disk.c | 8 ++++----
hw/scsi-generic.c | 18 ++++++++++++++----
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index bd7b661..5eaf69e 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -600,7 +600,7 @@ static void lsi_queue_command(LSIState *s)
{
lsi_request *p = s->current;
- DPRINTF("Queueing tag=0x%x\n", s->current_tag);
+ DPRINTF("Queueing tag=0x%x\n", p->tag);
assert(s->current != NULL);
assert(s->current->dma_len == 0);
QTAILQ_INSERT_TAIL(&s->queue, s->current, next);
@@ -880,7 +880,7 @@ static void lsi_do_msgout(LSIState *s)
break;
case 0x20: /* SIMPLE queue */
s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;
- DPRINTF("SIMPLE queue tag=0x%x\n", s->current_tag & 0xff);
+ DPRINTF("SIMPLE queue tag=0x%x\n", s->select_tag & 0xff);
break;
case 0x21: /* HEAD of queue */
BADF("HEAD queue not implemented\n");
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 0c90c77..b80c9bd 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -135,7 +135,7 @@ static void scsi_read_complete(void * opaque, int ret)
scsi_command_complete(r, CHECK_CONDITION, NO_SENSE);
return;
}
- DPRINTF("Data ready tag=0x%x len=%" PRId64 "\n", r->req.tag,
r->iov.iov_len);
+ DPRINTF("Data ready tag=0x%x len=%zd\n", r->req.tag, r->iov.iov_len);
r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag,
r->iov.iov_len);
}
@@ -155,7 +155,7 @@ static void scsi_read_data(SCSIDevice *d, uint32_t tag)
return;
}
if (r->sector_count == (uint32_t)-1) {
- DPRINTF("Read buf_len=%" PRId64 "\n", r->iov.iov_len);
+ DPRINTF("Read buf_len=%zd\n", r->iov.iov_len);
r->sector_count = 0;
r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag,
r->iov.iov_len);
return;
@@ -631,8 +631,8 @@ static int scsi_disk_emulate_mode_sense(SCSIRequest *req,
uint8_t *outbuf)
dbd = req->cmd.buf[1] & 0x8;
page = req->cmd.buf[2] & 0x3f;
page_control = (req->cmd.buf[2] & 0xc0) >> 6;
- DPRINTF("Mode Sense(%d) (page %d, len %d, page_control %d)\n",
- (req->cmd.buf[0] == MODE_SENSE) ? 6 : 10, page, len, page_control);
+ DPRINTF("Mode Sense(%d) (page %d, xfer %zd, page_control %d)\n",
+ (req->cmd.buf[0] == MODE_SENSE) ? 6 : 10, page, req->cmd.xfer,
page_control);
memset(outbuf, 0, req->cmd.xfer);
p = outbuf;
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index aa4f62a..9538027 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -164,7 +164,7 @@ static void scsi_read_complete(void * opaque, int ret)
int len;
if (ret) {
- DPRINTF("IO error\n");
+ DPRINTF("IO error ret %d\n", ret);
scsi_command_complete(r, ret);
return;
}
@@ -236,7 +236,7 @@ static void scsi_write_complete(void * opaque, int ret)
if (r->req.cmd.buf[0] == MODE_SELECT && r->req.cmd.buf[4] == 12 &&
s->qdev.type == TYPE_TAPE) {
s->qdev.blocksize = (r->buf[9] << 16) | (r->buf[10] << 8) | r->buf[11];
- DPRINTF("block size %d\n", s->blocksize);
+ DPRINTF("block size %d\n", s->qdev.blocksize);
}
scsi_command_complete(r, ret);
@@ -351,8 +351,18 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t
tag,
}
scsi_req_fixup(&r->req);
- DPRINTF("Command: lun=%d tag=0x%x data=0x%02x len %d\n", lun, tag,
- cmd[0], r->req.cmd.xfer);
+ DPRINTF("Command: lun=%d tag=0x%x len %zd data=0x%02x", lun, tag,
+ r->req.cmd.xfer, cmd[0]);
+
+#ifdef DEBUG_SCSI
+ {
+ int i;
+ for (i = 1; i < r->req.cmd.len; i++) {
+ printf(" 0x%02x", cmd[i]);
+ }
+ printf("\n");
+ }
+#endif
if (r->req.cmd.xfer == 0) {
if (r->buf != NULL)
--
1.7.2.2
- [Qemu-devel] [PULL v2 00/25] Block patches, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 06/25] vvfat: fat_chksum(): fix access above array bounds, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 17/25] scsi: fix and improve debug prints,
Kevin Wolf <=
- [Qemu-devel] [PATCH 15/25] scsi-disk: return CHECK CONDITION for unknown page codes in the MODE SENSE command, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 22/25] raw-posix: improve detection of scsi-generic devices, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 25/25] qcow2: Remove unnecessary flush after L2 write, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 14/25] scsi-disk: fix the block descriptor returned by the MODE SENSE command, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 18/25] qemu-io: Make alloc output useful when nb_sectors=1, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 02/25] virtio-blk: Fix migration of queued requests, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 05/25] qemu-img rebase: Open new backing file read-only, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 24/25] block: Fix BDRV_O_CACHE_MASK, Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 20/25] Improve ATA IDENTIFY word 64 contents., Kevin Wolf, 2010/09/08
- [Qemu-devel] [PATCH 23/25] qemu-img convert: Use cache=unsafe for output image, Kevin Wolf, 2010/09/08