Commit 70375c2d authored by David Matlack's avatar David Matlack Committed by Paolo Bonzini

Revert "KVM: set owner of cpu and vm file operations"

This reverts commit 3d3aab1b.

Now that the KVM module's lifetime is tied to kvm.users_count, there is
no need to also tie it's lifetime to the lifetime of the VM and vCPU
file descriptors.
Suggested-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Message-Id: <20220303183328.1499189-3-dmatlack@google.com>
Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 5f6de5cb
...@@ -3676,7 +3676,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp) ...@@ -3676,7 +3676,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
return 0; return 0;
} }
static struct file_operations kvm_vcpu_fops = { static const struct file_operations kvm_vcpu_fops = {
.release = kvm_vcpu_release, .release = kvm_vcpu_release,
.unlocked_ioctl = kvm_vcpu_ioctl, .unlocked_ioctl = kvm_vcpu_ioctl,
.mmap = kvm_vcpu_mmap, .mmap = kvm_vcpu_mmap,
...@@ -4727,7 +4727,7 @@ static long kvm_vm_compat_ioctl(struct file *filp, ...@@ -4727,7 +4727,7 @@ static long kvm_vm_compat_ioctl(struct file *filp,
} }
#endif #endif
static struct file_operations kvm_vm_fops = { static const struct file_operations kvm_vm_fops = {
.release = kvm_vm_release, .release = kvm_vm_release,
.unlocked_ioctl = kvm_vm_ioctl, .unlocked_ioctl = kvm_vm_ioctl,
.llseek = noop_llseek, .llseek = noop_llseek,
...@@ -5734,8 +5734,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, ...@@ -5734,8 +5734,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
goto out_free_5; goto out_free_5;
kvm_chardev_ops.owner = module; kvm_chardev_ops.owner = module;
kvm_vm_fops.owner = module;
kvm_vcpu_fops.owner = module;
r = misc_register(&kvm_dev); r = misc_register(&kvm_dev);
if (r) { if (r) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment