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] [xen-unstable] ioemu: serial save/load fix

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: serial save/load fix
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 May 2008 04:10:07 -0700
Delivery-date: Fri, 16 May 2008 04:10:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1210926610 -3600
# Node ID 13e10678e7148e37f12dcda7739ed15385cbb576
# Parent  f12724194ec6768baf865dc2d54afe646dbeac79
ioemu: serial save/load fix

This patch fixes several bugs in serial.c
 (1) A typo in serial_save() where qemu_get_8s is called (should be
     qemu_put_8s)
 (2) No support provided in serial_load() for version_id == 1 (should
     unmarshal a 1 byte s->divider and should provide a default value
     for s->fcr)
 (3) Call serial_ioport_write() to initialize s->fcr. It is not
     sufficient to load its value; other hidden values (such as
     s->recv_fifo.itl) must be re-initialized.

Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Signed-off-by: Robert Phillips <rphillips@xxxxxxxxxxxxxxx>
---
 tools/ioemu/hw/serial.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r f12724194ec6 -r 13e10678e714 tools/ioemu/hw/serial.c
--- a/tools/ioemu/hw/serial.c   Thu May 15 16:40:51 2008 +0100
+++ b/tools/ioemu/hw/serial.c   Fri May 16 09:30:10 2008 +0100
@@ -705,12 +705,13 @@ static void serial_save(QEMUFile *f, voi
     qemu_put_8s(f,&s->lsr);
     qemu_put_8s(f,&s->msr);
     qemu_put_8s(f,&s->scr);
-    qemu_get_8s(f,&s->fcr);
+    qemu_put_8s(f,&s->fcr);
 }
 
 static int serial_load(QEMUFile *f, void *opaque, int version_id)
 {
     SerialState *s = opaque;
+    uint8_t fcr = 0;
 
     if(version_id > 2)
         return -EINVAL;
@@ -729,6 +730,11 @@ static int serial_load(QEMUFile *f, void
     qemu_get_8s(f,&s->scr);
     qemu_get_8s(f,&s->fcr);
 
+    if (version_id >= 2)
+        qemu_get_8s(f,&fcr);
+
+    /* Initialize fcr via setter to perform essential side-effects */
+    serial_ioport_write(s, 0x02, fcr);
     return 0;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: serial save/load fix, Xen patchbot-unstable <=