mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
KVM: Use macro to iterate over vcpus.
[christian: remove unused variables on s390] Signed-off-by: Gleb Natapov <[email protected]> Signed-off-by: Christian Borntraeger <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
This commit is contained in:
parent
73880c80aa
commit
988a2cae6a
9 changed files with 76 additions and 74 deletions
|
|
@ -122,13 +122,17 @@ struct kvm *kvm_arch_create_vm(void)
|
|||
static void kvmppc_free_vcpus(struct kvm *kvm)
|
||||
{
|
||||
unsigned int i;
|
||||
struct kvm_vcpu *vcpu;
|
||||
|
||||
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
|
||||
if (kvm->vcpus[i]) {
|
||||
kvm_arch_vcpu_free(kvm->vcpus[i]);
|
||||
kvm->vcpus[i] = NULL;
|
||||
}
|
||||
}
|
||||
kvm_for_each_vcpu(i, vcpu, kvm)
|
||||
kvm_arch_vcpu_free(vcpu);
|
||||
|
||||
mutex_lock(&kvm->lock);
|
||||
for (i = 0; i < atomic_read(&kvm->online_vcpus); i++)
|
||||
kvm->vcpus[i] = NULL;
|
||||
|
||||
atomic_set(&kvm->online_vcpus, 0);
|
||||
mutex_unlock(&kvm->lock);
|
||||
}
|
||||
|
||||
void kvm_arch_sync_events(struct kvm *kvm)
|
||||
|
|
|
|||
Loading…
Reference in a new issue