From patchwork Thu Oct 22 14:36:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 36691 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 74757B7BB7 for ; Fri, 23 Oct 2009 02:11:29 +1100 (EST) Received: from localhost ([127.0.0.1]:48857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0zK1-0007Dv-Na for incoming@patchwork.ozlabs.org; Thu, 22 Oct 2009 11:11:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0ymp-0007mW-Tk for qemu-devel@nongnu.org; Thu, 22 Oct 2009 10:37:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0ymj-0007jL-TJ for qemu-devel@nongnu.org; Thu, 22 Oct 2009 10:37:06 -0400 Received: from [199.232.76.173] (port=46186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0ymj-0007jC-Dp for qemu-devel@nongnu.org; Thu, 22 Oct 2009 10:37:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65124) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0ymi-0007HE-Ry for qemu-devel@nongnu.org; Thu, 22 Oct 2009 10:37:01 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9MEb0e4010294 for ; Thu, 22 Oct 2009 10:37:00 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9MEaaik026416; Thu, 22 Oct 2009 10:36:59 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 22 Oct 2009 16:36:32 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 19/20] 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 b1a6395..8064fc3 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)); @@ -1336,7 +1331,7 @@ static int ac97_initfn (PCIDevice *dev) pci_register_bar (&s->dev, 0, 256 * 4, PCI_ADDRESS_SPACE_IO, ac97_map); pci_register_bar (&s->dev, 1, 64 * 4, PCI_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);