diff options
author | Avi Kivity <avi@redhat.com> | 2008-12-08 18:25:27 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 16:55:46 +0200 |
commit | 1a811b6167089bcdb84284f2dc9fd0b4d0f1899d (patch) | |
tree | 6a5d9fbf78475dd7fe2f0b85aa98dd8b82b660d8 | |
parent | 7f59f492da722eb3551bbe1f8f4450a21896f05d (diff) | |
download | linux-3.10-1a811b6167089bcdb84284f2dc9fd0b4d0f1899d.tar.gz linux-3.10-1a811b6167089bcdb84284f2dc9fd0b4d0f1899d.tar.bz2 linux-3.10-1a811b6167089bcdb84284f2dc9fd0b4d0f1899d.zip |
KVM: Advertise the bug in memory region destruction as fixed
Userspace might need to act differently.
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | include/linux/kvm.h | 2 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 0997e6f5490..48807767e72 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -395,6 +395,8 @@ struct kvm_trace_rec { #if defined(CONFIG_X86) #define KVM_CAP_DEVICE_MSI 20 #endif +/* Bug in KVM_SET_USER_MEMORY_REGION fixed: */ +#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 /* * ioctls for VM fds diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index e7644b90667..e066eb125e5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1905,6 +1905,17 @@ static int kvm_dev_ioctl_create_vm(void) return fd; } +static long kvm_dev_ioctl_check_extension_generic(long arg) +{ + switch (arg) { + case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: + return 1; + default: + break; + } + return kvm_dev_ioctl_check_extension(arg); +} + static long kvm_dev_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { @@ -1924,7 +1935,7 @@ static long kvm_dev_ioctl(struct file *filp, r = kvm_dev_ioctl_create_vm(); break; case KVM_CHECK_EXTENSION: - r = kvm_dev_ioctl_check_extension(arg); + r = kvm_dev_ioctl_check_extension_generic(arg); break; case KVM_GET_VCPU_MMAP_SIZE: r = -EINVAL; |