KVM: Introduce kvm_get_kvm_safe()
Introduce this safe version of kvm_get_kvm() so that it can be called even during vm destruction. Use it in kvm_debugfs_open() and remove the verbose comment. Prepare to be used elsewhere. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20210625153214.43106-3-peterx@redhat.com> [Preserve the comment in kvm_debugfs_open. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -755,6 +755,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
|
||||
void kvm_exit(void);
|
||||
|
||||
void kvm_get_kvm(struct kvm *kvm);
|
||||
bool kvm_get_kvm_safe(struct kvm *kvm);
|
||||
void kvm_put_kvm(struct kvm *kvm);
|
||||
bool file_is_kvm(struct file *file);
|
||||
void kvm_put_kvm_no_destroy(struct kvm *kvm);
|
||||
|
||||
Reference in New Issue
Block a user