diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2008-04-11 13:24:45 -0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 18:21:16 +0300 |
commit | 62d9f0dbc92d7e398fde53fc6021338393522e68 (patch) | |
tree | 028e62807ead3db11f15694323743b90c8211ef8 /virt | |
parent | a45352908b88d383bc40e1e4d1a6cc5bbcefc895 (diff) | |
download | lwn-62d9f0dbc92d7e398fde53fc6021338393522e68.tar.gz lwn-62d9f0dbc92d7e398fde53fc6021338393522e68.zip |
KVM: add ioctls to save/store mpstate
So userspace can save/restore the mpstate during migration.
[avi: export the #define constants describing the value]
[christian: add s390 stubs]
[avi: ditto for ia64]
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 47cbc6e3fafd..099845574901 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -979,6 +979,30 @@ out_free2: r = 0; break; } + case KVM_GET_MP_STATE: { + struct kvm_mp_state mp_state; + + r = kvm_arch_vcpu_ioctl_get_mpstate(vcpu, &mp_state); + if (r) + goto out; + r = -EFAULT; + if (copy_to_user(argp, &mp_state, sizeof mp_state)) + goto out; + r = 0; + break; + } + case KVM_SET_MP_STATE: { + struct kvm_mp_state mp_state; + + r = -EFAULT; + if (copy_from_user(&mp_state, argp, sizeof mp_state)) + goto out; + r = kvm_arch_vcpu_ioctl_set_mpstate(vcpu, &mp_state); + if (r) + goto out; + r = 0; + break; + } case KVM_TRANSLATE: { struct kvm_translation tr; |