support small buffer to read_console_ring()
PATCH 1/1 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 <[email protected]>
xen/drivers/char/console.c +3 -1
@@ -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
xen/drivers/char/console.c +3 -1
@@ -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); }
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel