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-changelog

[Xen-changelog] Fixed consoled race condition.

# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 4d018790ff8a17e6fcfce4e274fd4b9fac0ab568
# Parent  0fad07d67e758290d5921a82f6099fa6c186099f
Fixed consoled race condition.
Signed-off by: Andy Peace <andrew.peace@xxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 0fad07d67e75 -r 4d018790ff8a tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Tue Sep 13 10:05:49 2005
+++ b/tools/console/daemon/io.c Tue Sep 13 10:13:52 2005
@@ -87,6 +87,7 @@
        struct buffer *buffer = &dom->buffer;
        struct ring_head *ring = (struct ring_head *)dom->page;
        size_t size;
+       u32 oldcons;
 
        while ((size = ring->prod - ring->cons) != 0) {
                if ((buffer->capacity - buffer->size) < size) {
@@ -98,7 +99,8 @@
                        }
                }
 
-               while (ring->cons < ring->prod) {
+               oldcons = ring->cons;
+               while (ring->cons < (oldcons + size)) {
                        buffer->data[buffer->size] =
                                ring->buf[XENCONS_IDX(ring->cons)];
                        buffer->size++;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fixed consoled race condition., Xen patchbot -unstable <=