[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3] is_system_domain: replace open-coded instances
On 12/21/21 4:20 AM, Jan Beulich wrote: On 20.12.2021 17:28, Daniel P. Smith wrote:From: Christopher Clark <christopher.w.clark@xxxxxxxxx> This is a split out of the hyperlaunch dom0 series. There were several instances of open-coded domid range checking. This commit replaces those with the is_system_domain or is_system_domid inline function. Signed-off-by: Christopher Clark <christopher.w.clark@xxxxxxxxx> Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> Acked-by: Dario Faggioli <dfaggioli@xxxxxxxx>While I'm not outright opposed, I'd still like to raise the question whether we really want to intermix "is system domain" and "is in-range domain ID" predicates. Personally I'd prefer the latter to remain open-coded range checks.--- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -613,9 +613,14 @@ extern struct vcpu *idle_vcpu[NR_CPUS]; #define is_idle_domain(d) ((d)->domain_id == DOMID_IDLE) #define is_idle_vcpu(v) (is_idle_domain((v)->domain))+static inline bool is_system_domid(domid_t id)+{ + return (id >= DOMID_FIRST_RESERVED);Nit: Generally we omit parentheses in cases like this, ... ack +} + static inline bool is_system_domain(const struct domain *d) { - return d->domain_id >= DOMID_FIRST_RESERVED;... just like was the case here. Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |