mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
7bc3d711b4
commit
1c90ef2619
3 changed files with 39 additions and 2 deletions
|
@ -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 */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue