Skip to content

Commit

Permalink
KVM: Advertise the bug in memory region destruction as fixed
Browse files Browse the repository at this point in the history
Userspace might need to act differently.

Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
avikivity committed Dec 31, 2008
1 parent 7f59f49 commit 1a811b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/linux/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down

0 comments on commit 1a811b6

Please sign in to comment.