All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-dm: Fix Raw Block IO Debug Print
@ 2007-09-13 10:23 Yosuke Iwamatsu
  2007-09-13 11:02 ` Isaku Yamahata
  0 siblings, 1 reply; 3+ messages in thread
From: Yosuke Iwamatsu @ 2007-09-13 10:23 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

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
















[-- Attachment #2: fix_block_raw_print.patch --]
[-- Type: text/plain, Size: 2626 bytes --]

# HG changeset patch
# User Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
# Date 1189661813 -32400
# Node ID 785b0e83cad3458c4bacc1908de4e908f4b95378
# Parent  a00cc97b392a8e845f26f05817ffe1edcf8878d6
qemu-dm: fix block-raw io debug print

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

diff -r a00cc97b392a -r 785b0e83cad3 tools/ioemu/block-raw.c
--- a/tools/ioemu/block-raw.c	Wed Sep 12 09:43:33 2007 +0100
+++ b/tools/ioemu/block-raw.c	Thu Sep 13 14:36:53 2007 +0900
@@ -150,7 +150,7 @@ static int raw_pread(BlockDriverState *b
     if (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 *b
     if (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 *b
         if (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, 






[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] qemu-dm: Fix Raw Block IO Debug Print
  2007-09-13 10:23 [PATCH] qemu-dm: Fix Raw Block IO Debug Print Yosuke Iwamatsu
@ 2007-09-13 11:02 ` Isaku Yamahata
  2007-09-14  1:32   ` Yosuke Iwamatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Isaku Yamahata @ 2007-09-13 11:02 UTC (permalink / raw)
  To: Yosuke Iwamatsu; +Cc: xen-devel

On Thu, Sep 13, 2007 at 07:23:59PM +0900, Yosuke Iwamatsu wrote:
> 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.

-- 
yamahata

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] qemu-dm: Fix Raw Block IO Debug Print
  2007-09-13 11:02 ` Isaku Yamahata
@ 2007-09-14  1:32   ` Yosuke Iwamatsu
  0 siblings, 0 replies; 3+ messages in thread
From: Yosuke Iwamatsu @ 2007-09-14  1:32 UTC (permalink / raw)
  To: Isaku Yamahata, xen-devel

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

Isaku Yamahata wrote:
> On Thu, Sep 13, 2007 at 07:23:59PM +0900, Yosuke Iwamatsu wrote:
>> 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.
> 

Thank you for the comment.
Attached is a revised patch.

Regards,
-------------------
Yosuke Iwamatsu
         NEC Corporation

[-- Attachment #2: fix_block_raw_print_r1.patch --]
[-- Type: text/plain, Size: 2691 bytes --]

# HG changeset patch
# User Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
# Date 1189733245 -32400
# Node ID 0b5035b9e80ac8371269dc6b8a59cd4122d46f1f
# Parent  a00cc97b392a8e845f26f05817ffe1edcf8878d6
qemu-dm: fix block-raw io debug print

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

diff -r a00cc97b392a -r 0b5035b9e80a tools/ioemu/block-raw.c
--- a/tools/ioemu/block-raw.c	Wed Sep 12 09:43:33 2007 +0100
+++ b/tools/ioemu/block-raw.c	Fri Sep 14 10:27:25 2007 +0900
@@ -150,7 +150,7 @@ static int raw_pread(BlockDriverState *b
     if (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 *b
     if (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 *b
         if (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, 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-14  1:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-13 10:23 [PATCH] qemu-dm: Fix Raw Block IO Debug Print Yosuke Iwamatsu
2007-09-13 11:02 ` Isaku Yamahata
2007-09-14  1:32   ` Yosuke Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.