From patchwork Wed Dec 2 10:49:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 39991 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 4F0FFB7BDB for ; Wed, 2 Dec 2009 22:20:10 +1100 (EST) Received: from localhost ([127.0.0.1]:42339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFnFe-0003TA-KB for incoming@patchwork.ozlabs.org; Wed, 02 Dec 2009 06:20:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFmnE-00058g-9j for qemu-devel@nongnu.org; Wed, 02 Dec 2009 05:50:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFmn8-00052q-Kt for qemu-devel@nongnu.org; Wed, 02 Dec 2009 05:50:42 -0500 Received: from [199.232.76.173] (port=33735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFmn8-00052X-5P for qemu-devel@nongnu.org; Wed, 02 Dec 2009 05:50:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48223) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFmn7-000604-J5 for qemu-devel@nongnu.org; Wed, 02 Dec 2009 05:50:38 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2AoaQq007717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 05:50:36 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB2AoMJO016700; Wed, 2 Dec 2009 05:50:35 -0500 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 2 Dec 2009 11:49:41 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 09/10] ac97: up savevm version and remove active from state 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/ac97.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index e89a56a..cc5ec30 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -1170,7 +1170,6 @@ static void po_callback (void *opaque, int free) static void ac97_save (QEMUFile *f, void *opaque) { size_t i; - uint8_t active[LAST_INDEX]; AC97LinkState *s = opaque; pci_device_save (&s->dev, f); @@ -1193,11 +1192,6 @@ static void ac97_save (QEMUFile *f, void *opaque) qemu_put_be32s (f, &r->bd.ctl_len); } qemu_put_buffer (f, s->mixer_data, sizeof (s->mixer_data)); - - active[PI_INDEX] = AUD_is_active_in (s->voice_pi) ? 1 : 0; - active[PO_INDEX] = AUD_is_active_out (s->voice_po) ? 1 : 0; - active[MC_INDEX] = AUD_is_active_in (s->voice_mc) ? 1 : 0; - qemu_put_buffer (f, active, sizeof (active)); } static int ac97_load (QEMUFile *f, void *opaque, int version_id) @@ -1207,7 +1201,7 @@ static int ac97_load (QEMUFile *f, void *opaque, int version_id) uint8_t active[LAST_INDEX]; AC97LinkState *s = opaque; - if (version_id != 2) + if (version_id < 2 || version_id > 3) return -EINVAL; ret = pci_device_load (&s->dev, f); @@ -1232,7 +1226,8 @@ static int ac97_load (QEMUFile *f, void *opaque, int version_id) qemu_get_be32s (f, &r->bd.ctl_len); } qemu_get_buffer (f, s->mixer_data, sizeof (s->mixer_data)); - qemu_get_buffer (f, active, sizeof (active)); + if (version_id < 3) + qemu_get_buffer (f, active, sizeof (active)); #ifdef USE_MIXER record_select (s, mixer_load (s, AC97_Record_Select)); @@ -1337,7 +1332,7 @@ static int ac97_initfn (PCIDevice *dev) pci_register_bar (&s->dev, 0, 256 * 4, PCI_BASE_ADDRESS_SPACE_IO, ac97_map); pci_register_bar (&s->dev, 1, 64 * 4, PCI_BASE_ADDRESS_SPACE_IO, ac97_map); - register_savevm ("ac97", 0, 2, ac97_save, ac97_load, s); + register_savevm ("ac97", 0, 3, ac97_save, ac97_load, s); qemu_register_reset (ac97_on_reset, s); AUD_register_card ("ac97", &s->card); ac97_on_reset (s);