KVM: Advertise the bug in memory region destruction as fixed
authorAvi Kivity <avi@redhat.com>
Mon, 8 Dec 2008 16:25:27 +0000 (18:25 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:55:46 +0000 (16:55 +0200)
Userspace might need to act differently.

Signed-off-by: Avi Kivity <avi@redhat.com>
include/linux/kvm.h
virt/kvm/kvm_main.c

index 0997e6f5490c30dfca72ecb5577006f2d5b554a2..48807767e726bbe5a08fe5d89d3ffcc32dd2ae1d 100644 (file)
@@ -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
index e7644b90667e923ddd456dc82d51e8b94ef1e341..e066eb125e55eeea796a542b8f147b6bf84250b5 100644 (file)
@@ -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;