diff options
-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 0997e6f5490c..48807767e726 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -395,6 +395,8 @@ struct kvm_trace_rec { | |||
395 | #if defined(CONFIG_X86) | 395 | #if defined(CONFIG_X86) |
396 | #define KVM_CAP_DEVICE_MSI 20 | 396 | #define KVM_CAP_DEVICE_MSI 20 |
397 | #endif | 397 | #endif |
398 | /* Bug in KVM_SET_USER_MEMORY_REGION fixed: */ | ||
399 | #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 | ||
398 | 400 | ||
399 | /* | 401 | /* |
400 | * ioctls for VM fds | 402 | * ioctls for VM fds |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index e7644b90667e..e066eb125e55 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) | |||
1905 | return fd; | 1905 | return fd; |
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | static long kvm_dev_ioctl_check_extension_generic(long arg) | ||
1909 | { | ||
1910 | switch (arg) { | ||
1911 | case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: | ||
1912 | return 1; | ||
1913 | default: | ||
1914 | break; | ||
1915 | } | ||
1916 | return kvm_dev_ioctl_check_extension(arg); | ||
1917 | } | ||
1918 | |||
1908 | static long kvm_dev_ioctl(struct file *filp, | 1919 | static long kvm_dev_ioctl(struct file *filp, |
1909 | unsigned int ioctl, unsigned long arg) | 1920 | unsigned int ioctl, unsigned long arg) |
1910 | { | 1921 | { |
@@ -1924,7 +1935,7 @@ static long kvm_dev_ioctl(struct file *filp, | |||
1924 | r = kvm_dev_ioctl_create_vm(); | 1935 | r = kvm_dev_ioctl_create_vm(); |
1925 | break; | 1936 | break; |
1926 | case KVM_CHECK_EXTENSION: | 1937 | case KVM_CHECK_EXTENSION: |
1927 | r = kvm_dev_ioctl_check_extension(arg); | 1938 | r = kvm_dev_ioctl_check_extension_generic(arg); |
1928 | break; | 1939 | break; |
1929 | case KVM_GET_VCPU_MMAP_SIZE: | 1940 | case KVM_GET_VCPU_MMAP_SIZE: |
1930 | r = -EINVAL; | 1941 | r = -EINVAL; |