aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2008-04-11 12:24:45 -0400
committerAvi Kivity <avi@qumranet.com>2008-04-27 11:21:16 -0400
commit62d9f0dbc92d7e398fde53fc6021338393522e68 (patch)
tree028e62807ead3db11f15694323743b90c8211ef8 /virt/kvm
parenta45352908b88d383bc40e1e4d1a6cc5bbcefc895 (diff)
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/kvm')
-rw-r--r--virt/kvm/kvm_main.c24
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:
979 r = 0; 979 r = 0;
980 break; 980 break;
981 } 981 }
982 case KVM_GET_MP_STATE: {
983 struct kvm_mp_state mp_state;
984
985 r = kvm_arch_vcpu_ioctl_get_mpstate(vcpu, &mp_state);
986 if (r)
987 goto out;
988 r = -EFAULT;
989 if (copy_to_user(argp, &mp_state, sizeof mp_state))
990 goto out;
991 r = 0;
992 break;
993 }
994 case KVM_SET_MP_STATE: {
995 struct kvm_mp_state mp_state;
996
997 r = -EFAULT;
998 if (copy_from_user(&mp_state, argp, sizeof mp_state))
999 goto out;
1000 r = kvm_arch_vcpu_ioctl_set_mpstate(vcpu, &mp_state);
1001 if (r)
1002 goto out;
1003 r = 0;
1004 break;
1005 }
982 case KVM_TRANSLATE: { 1006 case KVM_TRANSLATE: {
983 struct kvm_translation tr; 1007 struct kvm_translation tr;
984 1008