summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJunaid Shahid <junaids@google.com>2019-11-04 12:22:02 +0100
committerThomas Gleixner <tglx@linutronix.de>2019-11-04 12:22:02 +0100
commitc57c80467f90e5504c8df9ad3555d2c78800bf94 (patch)
tree966043228f49ced836e69295f80305bc1ec29bc3 /include
parentb8e8c8303ff28c61046a4d0f6ea99aea609a7dc0 (diff)
kvm: Add helper function for creating VM worker threads
Add a function to create a kernel thread associated with a given VM. In particular, it ensures that the worker thread inherits the priority and cgroups of the calling thread. Signed-off-by: Junaid Shahid <junaids@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm_host.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 719fc3e15ea4..52ed5f66e8f9 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1382,4 +1382,10 @@ static inline int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu)
}
#endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */
+typedef int (*kvm_vm_thread_fn_t)(struct kvm *kvm, uintptr_t data);
+
+int kvm_vm_create_worker_thread(struct kvm *kvm, kvm_vm_thread_fn_t thread_fn,
+ uintptr_t data, const char *name,
+ struct task_struct **thread_ptr);
+
#endif