From: Avi Kivity Date: Mon, 23 Mar 2009 20:51:31 +0000 (-0300) Subject: KVM: Advertise the bug in memory region destruction as fixed X-Git-Tag: v2.6.28.10~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14e360ee2c711a4ce10d90389773cadea30c54f6;p=thirdparty%2Fkernel%2Fstable.git KVM: Advertise the bug in memory region destruction as fixed (cherry picked from 1a811b6167089bcdb84284f2dc9fd0b4d0f1899d) Userspace might need to act differently. Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f18b86fa86553..7c40a5a8e369f 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -387,6 +387,8 @@ struct kvm_trace_rec { #define KVM_CAP_DEVICE_ASSIGNMENT 17 #endif #define KVM_CAP_IOMMU 18 +/* 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 0c0f06666e825..d1cb5b3cbf12a 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1715,6 +1715,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) { @@ -1734,7 +1745,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;