WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [Patch] support small buffer to read_console_ring()
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Sun, 11 Jun 2006 10:25:20 +0900
Delivery-date: Sat, 10 Jun 2006 18:26:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [Patch] support small buffer to read_console_ring(), Akio Takebe <=