diff options
author | Avi Kivity <avi@redhat.com> | 2010-05-10 12:34:53 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 10:47:05 +0300 |
commit | a8eeb04a44dd6dc4c8158953d9bae48849c9a188 (patch) | |
tree | 70274957d251afb17c8aaf660363795b44bf993f /include/linux/kvm_host.h | |
parent | 36633f32ba4c238403d19584754b30fe469d6dcb (diff) |
KVM: Add mini-API for vcpu->requests
Makes it a little more readable and hackable.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 240e460777b..c8a9d628898 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -624,5 +624,20 @@ static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, #endif +static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) +{ + set_bit(req, &vcpu->requests); +} + +static inline bool kvm_make_check_request(int req, struct kvm_vcpu *vcpu) +{ + return test_and_set_bit(req, &vcpu->requests); +} + +static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) +{ + return test_and_clear_bit(req, &vcpu->requests); +} + #endif |