Received: from eggs.gnu.org ([208.118.235.92]:60156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLpt-0001Ay-0e for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFLpm-0008I5-1R for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:49:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60999 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLpl-0008Hf-RA for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:49:25 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5313AA4FFA for ; Tue, 12 Mar 2013 10:49:25 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 12 Mar 2013 10:49:10 +0100 Message-Id: <1363081758-12913-10-git-send-email-afaerber@suse.de> In-Reply-To: <1363081758-12913-1-git-send-email-afaerber@suse.de> References: <1363081758-12913-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 09/17] cpu: Introduce cpu_class_set_vmsd() 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?= This setter avoids redefining each VMStateDescription value to vmstate_dummy by not referencing the value for CONFIG_USER_ONLY. Suggested-by: Juan Quintela Reviewed-by: Eduardo Habkost Signed-off-by: Andreas F=C3=A4rber --- include/qom/cpu.h | 21 +++++++++++++++++++++ 1 Datei ge=C3=A4ndert, 21 Zeilen hinzugef=C3=BCgt(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 5b1b0d7..90c5f45 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -138,6 +138,27 @@ void cpu_reset(CPUState *cpu); ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_mod= el); =20 /** + * cpu_class_set_vmsd: + * @cc: CPU class + * @value: Value to set. Unused for %CONFIG_USER_ONLY. + * + * Sets #VMStateDescription for @cc. + * + * 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 #CPUState.vmsd directly instead. + */ +#ifndef CONFIG_USER_ONLY +static inline void cpu_class_set_vmsd(CPUClass *cc, + const struct VMStateDescription *v= alue) +{ + cc->vmsd =3D value; +} +#else +#define cpu_class_set_vmsd(cc, value) ((cc)->vmsd =3D NULL) +#endif + +/** * qemu_cpu_has_work: * @cpu: The vCPU to check. * --=20 1.7.10.4