[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [Patch] support small buffer to read_console_ring()



Hi,

read_console_ring() hung up when we pass smaller buffer than conringp - 
configc.
Doesn't read_console_ring() support small buffer than CONRING_SIZE?

I make a patch to support small buffer of read_console_ring.
Am I right?

Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>

diff -r aa2298739112 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Fri Jun 09 10:40:31 2006 -0600
+++ b/xen/drivers/char/console.c        Sun Jun 11 10:14:04 2006 +0900
@@ -238,6 +238,8 @@ long read_console_ring(XEN_GUEST_HANDLE(
             len = CONRING_SIZE - idx;
         if ( (sofar + len) > max )
             len = max - sofar;
+        if ( len == 0 )
+            break;
         if ( copy_to_guest_offset(str, sofar, &conring[idx], len) )
             return -EFAULT;
         sofar += len;
@@ -247,7 +249,7 @@ long read_console_ring(XEN_GUEST_HANDLE(
     if ( clear )
     {
         spin_lock_irqsave(&console_lock, flags);
-        conringc = conringp;
+        conringc += sofar;
         spin_unlock_irqrestore(&console_lock, flags);
     }
 

Best Regards,

Akio Takebe

Attachment: fix_readconsolering.patch
Description: Binary data

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.