aboutsummaryrefslogtreecommitdiff
path: root/target-i386/machine.c
diff options
context:
space:
mode:
authorVadim Rozenfeld <vrozenfe@redhat.com>2014-01-24 00:40:47 +1100
committerPaolo Bonzini <pbonzini@redhat.com>2014-02-03 17:33:55 +0100
commit1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac (patch)
treef79d7a86c624020e8fb6cf0624618e50948a9bed /target-i386/machine.c
parent7bc3d711b45d6feacab96eda410c5655f4ddafcf (diff)
downloadqemu-1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac.zip
qemu-1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac.tar.gz
qemu-1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac.tar.bz2
kvm: make hyperv hypercall and guest os id MSRs migratable.
Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r--target-i386/machine.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 2de1964..96fd045 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -554,6 +554,26 @@ static const VMStateDescription vmstate_mpx = {
}
};
+static bool hyperv_hypercall_enable_needed(void *opaque)
+{
+ X86CPU *cpu = opaque;
+ CPUX86State *env = &cpu->env;
+
+ return env->msr_hv_hypercall != 0 || env->msr_hv_guest_os_id != 0;
+}
+
+static const VMStateDescription vmstate_msr_hypercall_hypercall = {
+ .name = "cpu/msr_hyperv_hypercall",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField []) {
+ VMSTATE_UINT64(env.msr_hv_hypercall, X86CPU),
+ VMSTATE_UINT64(env.msr_hv_guest_os_id, X86CPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_x86_cpu = {
.name = "cpu",
.version_id = 12,
@@ -688,6 +708,9 @@ const VMStateDescription vmstate_x86_cpu = {
} , {
.vmsd = &vmstate_mpx,
.needed = mpx_needed,
+ }, {
+ .vmsd = &vmstate_msr_hypercall_hypercall,
+ .needed = hyperv_hypercall_enable_needed,
} , {
/* empty */
}