From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usb1n-0007a8-PF for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Usb1h-0003df-Q3 for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:56:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44119 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usb1h-0003dG-Jc for qemu-devel@nongnu.org; Fri, 28 Jun 2013 11:55:57 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DF64BA52C6 for ; Fri, 28 Jun 2013 17:55:56 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 28 Jun 2013 17:55:24 +0200 Message-Id: <1372434946-18489-3-git-send-email-afaerber@suse.de> In-Reply-To: <1372434946-18489-1-git-send-email-afaerber@suse.de> References: <1372434946-18489-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] [PULL 02/24] 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?= 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. Reviewed-by: Juan Quintela 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