From patchwork Mon Sep 14 23:08:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 33618 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 5BB1EB7099 for ; Tue, 15 Sep 2009 09:17:08 +1000 (EST) Received: from localhost ([127.0.0.1]:57830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnKnA-0000GW-Sa for incoming@patchwork.ozlabs.org; Mon, 14 Sep 2009 19:17:04 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnKhk-0006jE-Tf for qemu-devel@nongnu.org; Mon, 14 Sep 2009 19:11:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnKhg-0006iH-8d for qemu-devel@nongnu.org; Mon, 14 Sep 2009 19:11:28 -0400 Received: from [199.232.76.173] (port=58055 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnKhg-0006iE-2m for qemu-devel@nongnu.org; Mon, 14 Sep 2009 19:11:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1177) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnKhf-0007A7-AA for qemu-devel@nongnu.org; Mon, 14 Sep 2009 19:11:23 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8ENBMi3008412 for ; Mon, 14 Sep 2009 19:11:22 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8ENBHso003873; Mon, 14 Sep 2009 19:11:21 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 15 Sep 2009 01:08:37 +0200 Message-Id: <70899627085577947b5f317808180ea5b64060a5.1252969608.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 3/4] vmstate: remove ps2_kbd_load_old() 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 Now that we have version_id on post_load() we don't need the old load function Signed-off-by: Juan Quintela --- hw/ps2.c | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/ps2.c b/hw/ps2.c index fff4d13..0644e01 100644 --- a/hw/ps2.c +++ b/hw/ps2.c @@ -541,19 +541,11 @@ static const VMStateDescription vmstate_ps2_common = { } }; -static int ps2_kbd_load_old(QEMUFile* f, void* opaque, int version_id) +static int ps2_kbd_post_load(void* opaque, int version_id) { PS2KbdState *s = (PS2KbdState*)opaque; - if (version_id != 2 && version_id != 3) - return -EINVAL; - - vmstate_load_state(f, &vmstate_ps2_common, &s->common, version_id); - s->scan_enabled=qemu_get_be32(f); - s->translate=qemu_get_be32(f); - if (version_id == 3) - s->scancode_set=qemu_get_be32(f); - else + if (version_id == 2) s->scancode_set=2; return 0; } @@ -561,9 +553,9 @@ static int ps2_kbd_load_old(QEMUFile* f, void* opaque, int version_id) static const VMStateDescription vmstate_ps2_keyboard = { .name = "ps2kbd", .version_id = 3, - .minimum_version_id = 3, + .minimum_version_id = 2, .minimum_version_id_old = 2, - .load_state_old = ps2_kbd_load_old, + .post_load = ps2_kbd_post_load, .fields = (VMStateField []) { VMSTATE_STRUCT(common, PS2KbdState, 0, vmstate_ps2_common, PS2State), VMSTATE_INT32(scan_enabled, PS2KbdState),