summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-03-23 17:51:31 -0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-02 10:57:09 -0700
commit14e360ee2c711a4ce10d90389773cadea30c54f6 (patch)
treeebcdec899f5437aca75f76b36b349917bb6adb24
parent622d662934afe335af62dd8a0e9e64a39e8372dc (diff)
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 <avi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--include/linux/kvm.h2
-rw-r--r--virt/kvm/kvm_main.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index f18b86fa8655..7c40a5a8e369 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 0c0f06666e82..d1cb5b3cbf12 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;