[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 05/34] xen: is_hvm_domain should evaluate to 0 when !CONFIG_HVM



On Mon, Aug 20, 2018 at 10:23:47AM +0100, Andrew Cooper wrote:
> >
> >> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> >> index 51ceebe..fdd18a7 100644
> >> --- a/xen/include/xen/sched.h
> >> +++ b/xen/include/xen/sched.h
> >> @@ -879,8 +879,17 @@ void watchdog_domain_destroy(struct domain *d);
> >>
> >>  #define is_pv_domain(d) ((d)->guest_type == guest_type_pv)
> >>  #define is_pv_vcpu(v)   (is_pv_domain((v)->domain))
> >> -#define is_hvm_domain(d) ((d)->guest_type == guest_type_hvm)
> >> -#define is_hvm_vcpu(v)   (is_hvm_domain(v->domain))
> >> +
> >> +static inline bool is_hvm_domain(const struct domain *d)
> >> +{
> >> +    return IS_ENABLED(CONFIG_HVM) ? d->guest_type == guest_type_hvm : 
> >> false;
> >> +}
> >> +
> >> +static inline bool is_hvm_vcpu(const struct vcpu *v)
> >> +{
> >> +    return is_hvm_domain(v->domain);
> >> +}
> >> +
> > This should work too. I'm not too fuss whether is_hvm_* are macros or
> > functions.
> 
> static inlines are superior to macros in a lot of ways.  If in doubt,
> use a static inline (if you can.  we've got some header file tangles
> which occasionally make it very hard to use static inlines).

OK, sure.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.