diff options
author | Izik Eidus <izike@qumranet.com> | 2008-03-30 16:01:25 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 12:00:56 +0300 |
commit | d39f13b0da7fa7f705fbe6c80995205d0380bc7a (patch) | |
tree | febc1458c6225c70ca4c435047acf279fd77b019 /include/linux/kvm_host.h | |
parent | 9c20456a32ce9e82ccda55e12c10016b181d85e5 (diff) | |
download | kernel_goldelico_gta04-d39f13b0da7fa7f705fbe6c80995205d0380bc7a.zip kernel_goldelico_gta04-d39f13b0da7fa7f705fbe6c80995205d0380bc7a.tar.gz kernel_goldelico_gta04-d39f13b0da7fa7f705fbe6c80995205d0380bc7a.tar.bz2 |
KVM: add vm refcounting
the main purpose of adding this functions is the abilaty to release the
spinlock that protect the kvm list while still be able to do operations
on a specific kvm in a safe way.
Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index f4e1436..a2ceb51 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -114,6 +114,7 @@ struct kvm { struct kvm_io_bus pio_bus; struct kvm_vm_stat stat; struct kvm_arch arch; + atomic_t users_count; }; /* The guest did something we don't support. */ @@ -140,6 +141,9 @@ int kvm_init(void *opaque, unsigned int vcpu_size, struct module *module); void kvm_exit(void); +void kvm_get_kvm(struct kvm *kvm); +void kvm_put_kvm(struct kvm *kvm); + #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } |