From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uojo4-0004Ms-3M for qemu-devel@nongnu.org; Mon, 17 Jun 2013 20:29:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uojo1-00078w-AR for qemu-devel@nongnu.org; Mon, 17 Jun 2013 20:29:56 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38621 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uojo1-00078c-3z for qemu-devel@nongnu.org; Mon, 17 Jun 2013 20:29:53 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 18 Jun 2013 02:29:41 +0200 Message-Id: <1371515385-32203-3-git-send-email-afaerber@suse.de> In-Reply-To: <1371515385-32203-1-git-send-email-afaerber@suse.de> References: <1371515385-32203-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-cpu v3 2/6] cpu: Introduce device_class_set_vmsd() helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , quintela@redhat.com It's the equivalent to cpu_class_set_vmsd(), to assign DeviceClass::vmsd. It wasn't needed before since only static, unmigratable VMStateDescriptions were assigned so far. Signed-off-by: Andreas F=C3=A4rber --- include/qom/cpu.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 55a85c1..397219b 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -239,6 +239,27 @@ static inline void cpu_class_set_vmsd(CPUClass *cc, #endif =20 /** + * device_class_set_vmsd: + * @dc: Device class + * @value: Value to set. Unused for %CONFIG_USER_ONLY. + * + * Sets #VMStateDescription for @dc. + * + * The @value argument is intentionally discarded for the non-softmmu ta= rgets + * to avoid linker errors or excessive preprocessor usage. If this behav= ior + * is undesired, you should assign #DeviceClass.vmsd directly instead. + */ +#ifndef CONFIG_USER_ONLY +static inline void device_class_set_vmsd(DeviceClass *dc, + const struct VMStateDescription= *value) +{ + dc->vmsd =3D value; +} +#else +#define device_class_set_vmsd(dc, value) ((dc)->vmsd =3D NULL) +#endif + +/** * qemu_cpu_has_work: * @cpu: The vCPU to check. * --=20 1.8.1.4