>>> On 03.09.18 at 16:46, <andrew.coop...@citrix.com> wrote:
> Given two subtle failures from getting this wrong before, and more cleanup on
> the way, move the setting of d->guest_type as early as possible.
> 
> Note that despite moving the assignment of d->guest_type outside of the
> is_idle_domain(d) check, it still behaves the same.  Previously, system
> domains had no direct assignment of d->guest_type and behaved as PV guests
> because guest_type_pv has the value 0.
> 
> While tidying up the predicate, leave a comment refering to
> is_system_domain(), and move the associated ASSERT() to be beside the
> asignment.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Acked-by: Jan Beulich <jbeul...@suse.com>

> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -272,8 +272,12 @@ struct domain *domain_create(domid_t domid,
>      if ( (d = alloc_domain_struct()) == NULL )
>          return ERR_PTR(-ENOMEM);
>  
> +    /* Sort out our idea of is_system_domain(). */
>      d->domain_id = domid;
>  
> +    /* Debug sanity. */
> +    ASSERT(is_system_domain(d) ? config == NULL : config != NULL);

Would you mind shortening this to at least

    ASSERT(is_system_domain(d) ? !config : config);

while you move it?

Jan



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

Reply via email to