lkml.org 
[lkml]   [2011]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kvm: make vcpu life cycle separated from kvm instance
On 12/05/2011 07:29 AM, Liu ping fan wrote:
> like this,
> #define kvm_for_each_vcpu(idx, cnt, vcpup, kvm) \
> for (idx = 0, cnt = 0, vcpup = kvm_get_vcpu(kvm, idx); \
> cnt < atomic_read(&kvm->online_vcpus) && \
> idx < KVM_MAX_VCPUS; \
> idx++, (vcpup == NULL)?:cnt++, vcpup = kvm_get_vcpu(kvm, idx)) \
> if (vcpup == NULL) \
> continue; \
> else
>
>
> A little ugly, but have not thought a better way out :-)
>

#define kvm_for_each_vcpu(vcpu, it) for (vcpu = kvm_fev_init(&it); vcpu;
vcpu = kvm_fev_next(&it, vcpu))

Though that doesn't give a good place for rcu_read_unlock().



--
error compiling committee.c: too many arguments to function



\
 
 \ /
  Last update: 2011-12-05 10:33    [W:0.093 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site