From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48803 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2NJc-0006XP-S6 for qemu-devel@nongnu.org; Wed, 23 Mar 2011 08:37:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2NJa-0001hh-4F for qemu-devel@nongnu.org; Wed, 23 Mar 2011 08:37:31 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:58590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2NJa-0001hX-1h for qemu-devel@nongnu.org; Wed, 23 Mar 2011 08:37:30 -0400 Received: by ywl41 with SMTP id 41so4004235ywl.4 for ; Wed, 23 Mar 2011 05:37:29 -0700 (PDT) Message-ID: <4D89E980.9020805@codemonkey.ws> Date: Wed, 23 Mar 2011 07:37:20 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 02/11] vmstate: register all VMStateDescriptions References: <1300839376-22520-1-git-send-email-aliguori@us.ibm.com> <1300839376-22520-3-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org, Juan Quintela On 03/23/2011 07:30 AM, Peter Maydell wrote: > On 23 March 2011 00:16, Anthony Liguori wrote: >> This is a purely mechanical change. >> +/* Register the VMState Description to support VMState introspection */ >> +static void init_vmstate_description_0(void) >> +{ >> + register_vmstate_description(&vmstate_ac97); >> +} >> + >> +vmstate_init(init_vmstate_description_0); >> + >> +/* Register the VMState Description to support VMState introspection */ >> +static void init_vmstate_description_0(void) >> +{ >> + register_vmstate_description(&vmstate_acpi); >> +} >> + >> +vmstate_init(init_vmstate_description_0); >> + > Do we really need five lines of boilerplate for every device? > > (I'm wondering if there's some way you could avoid having > all this for the common case where the vmstate is pointed to > by the DeviceInfo struct, given that we already register > all the devices. Failing that, some sort of macro...) Heh, well that just goes right and head and tremendously simplifies everything :-) There are just a few cases where VMStateDescription is not reachable via DeviceInfo so DeviceInfo is definitely the way to go. Regards, Anthony Liguori > -- PMM >