KVM: Advertise the bug in memory region destruction as fixed

Userspace might need to act differently.

Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity
2008-12-08 18:25:27 +02:00
parent 7f59f492da
commit 1a811b6167
2 changed files with 14 additions and 1 deletions

View File

@@ -395,6 +395,8 @@ struct kvm_trace_rec {
#if defined(CONFIG_X86) #if defined(CONFIG_X86)
#define KVM_CAP_DEVICE_MSI 20 #define KVM_CAP_DEVICE_MSI 20
#endif #endif
/* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
/* /*
* ioctls for VM fds * ioctls for VM fds

View File

@@ -1905,6 +1905,17 @@ static int kvm_dev_ioctl_create_vm(void)
return fd; 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, static long kvm_dev_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg) unsigned int ioctl, unsigned long arg)
{ {
@@ -1924,7 +1935,7 @@ static long kvm_dev_ioctl(struct file *filp,
r = kvm_dev_ioctl_create_vm(); r = kvm_dev_ioctl_create_vm();
break; break;
case KVM_CHECK_EXTENSION: case KVM_CHECK_EXTENSION:
r = kvm_dev_ioctl_check_extension(arg); r = kvm_dev_ioctl_check_extension_generic(arg);
break; break;
case KVM_GET_VCPU_MMAP_SIZE: case KVM_GET_VCPU_MMAP_SIZE:
r = -EINVAL; r = -EINVAL;