diff options
author | Qing He <qing.he@intel.com> | 2007-07-12 12:33:56 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 10:18:17 +0200 |
commit | dad3795d2baa4e02cbfd161d9089c73dea16b4ba (patch) | |
tree | 56bedc042a5ba0a2b92eecc4e488b0328a35db54 /drivers/kvm/kvm_main.c | |
parent | cd0d91379776cb6850c7b11c0a8843ca75967558 (diff) | |
download | lwn-dad3795d2baa4e02cbfd161d9089c73dea16b4ba.tar.gz lwn-dad3795d2baa4e02cbfd161d9089c73dea16b4ba.zip |
KVM: SMP: Add vcpu_id field in struct vcpu
This patch adds a `vcpu_id' field in `struct vcpu', so we can
differentiate BSP and APs without pointer comparison or arithmetic.
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 36a458f13ec4..df9c05e9b34e 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -2355,6 +2355,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int n) goto out; vcpu = &kvm->vcpus[n]; + vcpu->vcpu_id = n; mutex_lock(&vcpu->mutex); |