summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorAndrey Smetanin <asmetanin@virtuozzo.com>2015-07-03 15:01:44 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2015-09-16 17:33:32 +0200
commitbac05aa9a77af1ca7972c8dc07560f4daa7c2dfc (patch)
tree4337c6c7b4e9a5bbcfb48cb5f674712de4dc68d5 /exec.c
parent73aa529a48b4ed7fce21fc74e62fb24db526af5f (diff)
downloadqemu-bac05aa9a77af1ca7972c8dc07560f4daa7c2dfc.zip
cpu: Add crash_occurred flag into CPUState
CPUState::crash_occurred field inside CPUState marks that guest crash occurred. This value is added into cpu common migration subsection. Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Andreas Färber <afaerber@suse.de> Message-Id: <1435924905-8926-12-git-send-email-den@openvz.org> [Document the new field. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index b61126cb76..07dfeae4d8 100644
--- a/exec.c
+++ b/exec.c
@@ -478,6 +478,24 @@ static const VMStateDescription vmstate_cpu_common_exception_index = {
}
};
+static bool cpu_common_crash_occurred_needed(void *opaque)
+{
+ CPUState *cpu = opaque;
+
+ return cpu->crash_occurred;
+}
+
+static const VMStateDescription vmstate_cpu_common_crash_occurred = {
+ .name = "cpu_common/crash_occurred",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = cpu_common_crash_occurred_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_BOOL(crash_occurred, CPUState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_cpu_common = {
.name = "cpu_common",
.version_id = 1,
@@ -491,6 +509,7 @@ const VMStateDescription vmstate_cpu_common = {
},
.subsections = (const VMStateDescription*[]) {
&vmstate_cpu_common_exception_index,
+ &vmstate_cpu_common_crash_occurred,
NULL
}
};