From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>, quintela@redhat.com
Subject: [Qemu-devel] [PATCH qom-cpu v3 3/6] cpu: Introduce VMSTATE_CPU() macro for CPUState
Date: Tue, 18 Jun 2013 02:29:42 +0200 [thread overview]
Message-ID: <1371515385-32203-4-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1371515385-32203-1-git-send-email-afaerber@suse.de>
To be used to embed common CPU state into CPU subclasses.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
exec.c | 5 ++---
include/qom/cpu.h | 14 ++++++++++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/exec.c b/exec.c
index 5b8b40d..0bee004 100644
--- a/exec.c
+++ b/exec.c
@@ -246,7 +246,7 @@ static int cpu_common_post_load(void *opaque, int version_id)
return 0;
}
-static const VMStateDescription vmstate_cpu_common = {
+const VMStateDescription vmstate_cpu_common = {
.name = "cpu_common",
.version_id = 1,
.minimum_version_id = 1,
@@ -258,8 +258,7 @@ static const VMStateDescription vmstate_cpu_common = {
VMSTATE_END_OF_LIST()
}
};
-#else
-#define vmstate_cpu_common vmstate_dummy
+
#endif
CPUState *qemu_get_cpu(int index)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 397219b..3e8cc47 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -378,4 +378,18 @@ void cpu_reset_interrupt(CPUState *cpu, int mask);
*/
void cpu_resume(CPUState *cpu);
+#ifdef CONFIG_SOFTMMU
+extern const struct VMStateDescription vmstate_cpu_common;
+#else
+#define vmstate_cpu_common vmstate_dummy
+#endif
+
+#define VMSTATE_CPU() { \
+ .name = "parent_obj", \
+ .size = sizeof(CPUState), \
+ .vmsd = &vmstate_cpu_common, \
+ .flags = VMS_STRUCT, \
+ .offset = 0, \
+}
+
#endif
--
1.8.1.4
next prev parent reply other threads:[~2013-06-18 0:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 0:29 [Qemu-devel] [PATCH qom-cpu v3 0/6] QOM CPUState migration, next generation Andreas Färber
2013-06-18 0:29 ` [Qemu-devel] [PATCH qom-cpu v3 1/6] cpu: Fix cpu_class_set_vmsd() documentation Andreas Färber
2013-06-18 2:30 ` li guang
2013-06-18 11:43 ` Juan Quintela
2013-06-18 0:29 ` [Qemu-devel] [PATCH qom-cpu v3 2/6] cpu: Introduce device_class_set_vmsd() helper Andreas Färber
2013-06-18 11:45 ` Juan Quintela
2013-06-18 0:29 ` Andreas Färber [this message]
2013-06-18 0:29 ` [Qemu-devel] [PATCH qom-cpu v3 4/6] target-alpha: Register VMStateDescription for AlphaCPU Andreas Färber
2013-06-18 11:50 ` Juan Quintela
2013-06-18 14:40 ` Richard Henderson
2013-06-18 0:29 ` [Qemu-devel] [PATCH qom-cpu v3 5/6] target-openrisc: Register VMStateDescription for OpenRISCCPU Andreas Färber
2013-06-18 11:51 ` Juan Quintela
2013-06-18 0:29 ` [Qemu-devel] [PATCH qom-cpu v3 6/6] cpu: Guard cpu_{save, load}() definitions Andreas Färber
2013-06-18 11:51 ` Juan Quintela
2013-06-18 15:33 ` [Qemu-devel] [PATCH qom-cpu v3 0/6] QOM CPUState migration, next generation Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371515385-32203-4-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).