qemu-dm: Fix Raw Block IO Debug Print
PATCH 1/1 qemu-dm: Fix Raw Block IO Debug Print
Hi,
This is a trivial fix for debug print formats of raw block io. Without this patch, qemu-dm occasionally gets stuck when a raw io device is inaccessible (eg. CR-ROM doesn't exist).
Regards,
-------------------
Yosuke Iwamatsu
NEC Corporation
# HG changeset patch
# User Yosuke Iwamatsu <[email protected]> # Date 1189661813 -32400
# Node ID 785b0e83cad3458c4bacc1908de4e908f4b95378 # Parent a00cc97b392a8e845f26f05817ffe1edcf8878d6
qemu-dm: fix block-raw io debug print
tools/ioemu/block-raw.c +5 -5
@@ -150,7 +150,7 @@ static int raw_pread(BlockDriverState *bif (lseek (s->fd, offset,SEEK_SET ) == (off_t)-1 ) { ++(s->lseek_err_cnt);if (s->lseek_err_cnt <=10 ) { - DEBUG_BLOCK_PRINT("raw_pread(%d:%s, %ld, %p, %d) [%ld] lseek failed : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_pread(%d:%s, %lld, %p, %d) [%lld] lseek failed : %d = %s\n", s->fd, bs->filename, offset,
@@ -166,7 +166,7 @@ static int raw_pread(BlockDriverState *bif (ret == count) goto label__raw_read__success; - DEBUG_BLOCK_PRINT("raw_read(%d:%s, %ld, %p, %d) [%ld] read failed %d : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_read(%d:%s, %lld, %p, %d) [%lld] read failed %d : %d = %s\n", s->fd, bs->filename, offset,
@@ -185,7 +185,7 @@ static int raw_pread(BlockDriverState *bif (ret == count) goto label__raw_read__success; - DEBUG_BLOCK_PRINT("raw_read(%d:%s, %ld, %p, %d) [%ld] retry read failed %d : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_read(%d:%s, %lld, %p, %d) [%lld] retry read failed %d : %d = %s\n", s->fd, bs->filename, offset,
@@ -215,7 +215,7 @@ static int raw_pwrite(BlockDriverState *if (lseek (s->fd, offset,SEEK_SET ) == (off_t)-1 ) { ++(s->lseek_err_cnt);if (s->lseek_err_cnt) { - DEBUG_BLOCK_PRINT("raw_write(%d:%s, %ld, %p, %d) [%ld] lseek failed : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_write(%d:%s, %lld, %p, %d) [%lld] lseek failed : %d = %s\n", s->fd, bs->filename, offset,
@@ -231,7 +231,7 @@ static int raw_pwrite(BlockDriverState *if (ret == count) goto label__raw_write__success; - DEBUG_BLOCK_PRINT("raw_write(%d:%s, %ld, %p, %d) [%ld] write failed %d : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_write(%d:%s, %lld, %p, %d) [%lld] write failed %d : %d = %s\n", s->fd, bs->filename, offset,
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · Yosuke Iwamatsu
Hi,
This is a trivial fix for debug print formats of raw block io. Without this patch, qemu-dm occasionally gets stuck when a raw io device is inaccessible (eg. CR-ROM doesn't exist).
Hi.
PRId64 should be used for int64_t instead of lld.
Signature · 1 line
yamahata
PATCH 1/1 qemu-dm: Fix Raw Block IO Debug Print
Quoted 10 lines · Isaku Yamahata
Quoted 5 lines · Yosuke Iwamatsu
Hi,
This is a trivial fix for debug print formats of raw block io. Without this patch, qemu-dm occasionally gets stuck when a raw io device is inaccessible (eg. CR-ROM doesn't exist).
Hi.
PRId64 should be used forint64_tinstead of lld.
Thank you for the comment.
Attached is a revised patch.
Regards,
-------------------
Yosuke Iwamatsu
NEC Corporation
# HG changeset patch
# User Yosuke Iwamatsu <[email protected]> # Date 1189733245 -32400
# Node ID 0b5035b9e80ac8371269dc6b8a59cd4122d46f1f # Parent a00cc97b392a8e845f26f05817ffe1edcf8878d6
qemu-dm: fix block-raw io debug print
tools/ioemu/block-raw.c +5 -5
@@ -150,7 +150,7 @@ static int raw_pread(BlockDriverState *bif (lseek (s->fd, offset,SEEK_SET ) == (off_t)-1 ) { ++(s->lseek_err_cnt);if (s->lseek_err_cnt <=10 ) { - DEBUG_BLOCK_PRINT("raw_pread(%d:%s, %ld, %p, %d) [%ld] lseek failed : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_pread(%d:%s, %" PRId64 ", %p, %d) [%" PRId64 "] lseek failed : %d = %s\n", s->fd, bs->filename, offset,
@@ -166,7 +166,7 @@ static int raw_pread(BlockDriverState *bif (ret == count) goto label__raw_read__success; - DEBUG_BLOCK_PRINT("raw_read(%d:%s, %ld, %p, %d) [%ld] read failed %d : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_read(%d:%s, %" PRId64 ", %p, %d) [%" PRId64 "] read failed %d : %d = %s\n", s->fd, bs->filename, offset,
@@ -185,7 +185,7 @@ static int raw_pread(BlockDriverState *bif (ret == count) goto label__raw_read__success; - DEBUG_BLOCK_PRINT("raw_read(%d:%s, %ld, %p, %d) [%ld] retry read failed %d : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_read(%d:%s, %" PRId64 ", %p, %d) [%" PRId64 "] retry read failed %d : %d = %s\n", s->fd, bs->filename, offset,
@@ -215,7 +215,7 @@ static int raw_pwrite(BlockDriverState *if (lseek (s->fd, offset,SEEK_SET ) == (off_t)-1 ) { ++(s->lseek_err_cnt);if (s->lseek_err_cnt) { - DEBUG_BLOCK_PRINT("raw_write(%d:%s, %ld, %p, %d) [%ld] lseek failed : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_write(%d:%s, %" PRId64 ", %p, %d) [%" PRId64 "] lseek failed : %d = %s\n", s->fd, bs->filename, offset,
@@ -231,7 +231,7 @@ static int raw_pwrite(BlockDriverState *if (ret == count) goto label__raw_write__success; - DEBUG_BLOCK_PRINT("raw_write(%d:%s, %ld, %p, %d) [%ld] write failed %d : %d = %s\n", + DEBUG_BLOCK_PRINT("raw_write(%d:%s, %" PRId64 ", %p, %d) [%" PRId64 "] write failed %d : %d = %s\n", s->fd, bs->filename, offset,
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel