From patchwork Mon Oct 19 18:42:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 36393 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 158A4B7B72 for ; Tue, 20 Oct 2009 05:47:58 +1100 (EST) Received: from localhost ([127.0.0.1]:37510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzxGs-0007tJ-U1 for incoming@patchwork.ozlabs.org; Mon, 19 Oct 2009 14:47:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzxCv-00061T-Bl for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:43:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzxCq-0005zw-7E for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:43:48 -0400 Received: from [199.232.76.173] (port=49034 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzxCq-0005zl-2K for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:43:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47774) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzxCp-0006I7-Kd for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:43:43 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9JIhgKf025202 for ; Mon, 19 Oct 2009 14:43:43 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9JIhcBt012656; Mon, 19 Oct 2009 14:43:41 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 19 Oct 2009 20:42:47 +0200 Message-Id: <238d3cf2aaea580ffc5042d1c2856cf92b66541c.1255976538.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 02/25] serial: use post_load version_id field and remove pre_load function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- hw/serial.c | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/serial.c b/hw/serial.c index eb14f11..ea4154f 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -648,17 +648,13 @@ static void serial_pre_save(void *opaque) s->fcr_vmstate = s->fcr; } -static int serial_pre_load(void *opaque) -{ - SerialState *s = opaque; - s->fcr_vmstate = 0; - return 0; -} - static int serial_post_load(void *opaque, int version_id) { SerialState *s = opaque; + if (version_id < 3) { + s->fcr_vmstate = 0; + } /* Initialize fcr via setter to perform essential side-effects */ serial_ioport_write(s, 0x02, s->fcr_vmstate); return 0; @@ -669,7 +665,6 @@ static const VMStateDescription vmstate_serial = { .version_id = 3, .minimum_version_id = 2, .pre_save = serial_pre_save, - .pre_load = serial_pre_load, .post_load = serial_post_load, .fields = (VMStateField []) { VMSTATE_UINT16_V(divider, SerialState, 2),