Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mt11b-0002Ez-Kl for qemu-devel@nongnu.org; Wed, 30 Sep 2009 11:23:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mt11W-00028p-Sf for qemu-devel@nongnu.org; Wed, 30 Sep 2009 11:23:26 -0400 Received: from [199.232.76.173] (port=48938 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mt11W-00028Z-IS for qemu-devel@nongnu.org; Wed, 30 Sep 2009 11:23:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39342) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mt11W-0004CZ-4n for qemu-devel@nongnu.org; Wed, 30 Sep 2009 11:23:22 -0400 From: Juan Quintela In-Reply-To: <4AC37476.60007@codemonkey.ws> (Anthony Liguori's message of "Wed, 30 Sep 2009 10:08:38 -0500") References: <4AC37476.60007@codemonkey.ws> Date: Wed, 30 Sep 2009 17:22:59 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 27/49] ac97: add active to the state List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > malc wrote: >>>>> + >>>>> typedef struct AC97LinkState { >>>>> PCIDevice dev; >>>>> QEMUSoundCard card; >>>>> @@ -162,6 +169,7 @@ typedef struct AC97LinkState { >>>>> uint8_t silence[128]; >>>>> uint32_t base[2]; >>>>> int bup_flag; >>>>> + uint8_t active[LAST_INDEX]; >>>>> >>>> This doesn't belong here, cause the only purpose i can see is to hack >>>> around defficiencies of the new load/savevm APIs. >>>> >>> That was supposed to be one of the features, not deficiences. You can't >>> sent stuff that it is not in the state. It is "by design" that you can't >>> sent arbitrary variables. >>> >> >> active doesn't belong in the above structure, it's not used for anything >> other than save/loadvm. If this "design" doesn't allow this, either find >> another way to accomplish the same or fix the "design". >> > > Looking briefly at the code, it looks like the active[] array isn't > technically needed in the savevm state. > > I think you could basically do: > > AUD_set_active_in(s->voice_pi, !!(s->bm_regs[PI_INDEX].cr & CR_RPBM)); > ... I don't doubt that you are right. I don't understand that bit of the code. active is created in other way, but I don't know if they are equivalent or not. > Better yet, active[] can be dynamically built from the contents of > bm_regs->cr so there would be little code change. > > So I think we should bump the version of the ac97 format, remove the > active[] array from the vmstate, and then generate it in a post > function that can then be passed to reset_voices(). Malc? Later, Juan.