Skip to content

Commit ba4e72b

Browse files
peterfangNanlinXie
authored andcommitted
dm: virtio: add debugging information in virtio-blk
Output debugging message when virtio-blk completes with error. v1 -> v2: - fix coding style - refine debugging message Tracked-On: #1422 Signed-off-by: Peter Fang <peter.fang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent 7101ce8 commit ba4e72b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

devicemodel/hw/pci/virtio/virtio_block.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ virtio_blk_done(struct blockif_req *br, int err)
171171
struct virtio_blk_ioreq *io = br->param;
172172
struct virtio_blk *blk = io->blk;
173173

174+
if (err)
175+
DPRINTF(("virtio_blk: done with error = %d\n\r", err));
176+
174177
/* convert errno into a virtio block error return */
175178
if (err == EOPNOTSUPP || err == ENOSYS)
176179
*io->status = VIRTIO_BLK_S_UNSUPP;
@@ -245,7 +248,7 @@ virtio_blk_proc(struct virtio_blk *blk, struct virtio_vq_info *vq)
245248
}
246249
io->req.resid = iolen;
247250

248-
DPRINTF(("virtio-block: %s op, %zd bytes, %d segs, offset %ld\n\r",
251+
DPRINTF(("virtio_blk: %s op, %zd bytes, %d segs, offset %ld\n\r",
249252
writeop ? "write" : "read/ident", iolen, i - 1,
250253
io->req.offset));
251254

@@ -309,7 +312,7 @@ virtio_blk_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
309312
int rc;
310313

311314
if (opts == NULL) {
312-
printf("virtio-block: backing device required\n");
315+
printf("virtio_blk: backing device required\n");
313316
return -1;
314317
}
315318

0 commit comments

Comments
 (0)