From: "Jan Beulich" Subject: Re: [PATCH v6a 12/17] xen/arm: move and rename is_vcpu_running function to sched.h Date: Thu, 26 Jun 2014 10:41:32 +0100 Message-ID: <53AC06EC020000780001D83E@mail.emea.novell.com> References: <1403760849-14627-1-git-send-email-vijay.kilari@gmail.com> <1403760849-14627-13-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1403760849-14627-13-git-send-email-vijay.kilari@gmail.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , julien.grall@linaro.org, tim@xen.org, george.dunlap@citrix.com, xen-devel@lists.xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 26.06.14 at 07:34, wrote: > --- a/xen/include/xen/sched.h > +++ b/xen/include/xen/sched.h > @@ -829,6 +829,22 @@ void watchdog_domain_destroy(struct domain *d); > #define need_iommu(d) (0) > #endif > > +static inline bool_t is_vcpu_online(const struct domain *d, int vcpuid) unsigned int please. > +{ > + const struct vcpu *v; > + > + if ( vcpuid >= d->max_vcpus || d->vcpu == NULL ) > + return 0; > + > + v = d->vcpu[vcpuid]; > + if ( v == NULL ) > + return 0; > + if ( test_bit(_VPF_down, &v->pause_flags) ) > + return 0; > + > + return 1; I'd prefer the simpler "return !test_bit()". Jan