qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/11] vmstate: register all VMStateDescriptions


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 02/11] vmstate: register all VMStateDescriptions
Date: Wed, 23 Mar 2011 07:37:20 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 03/23/2011 07:30 AM, Peter Maydell wrote:
On 23 March 2011 00:16, Anthony Liguori<address@hidden>  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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]