On 01/10/18 11:25, Jan Beulich wrote:
>>>> On 01.10.18 at 12:23, <andrew.coop...@citrix.com> wrote:
>> On 01/10/18 11:14, Jan Beulich wrote:
>>>>>> On 01.10.18 at 12:02, <andrew.coop...@citrix.com> wrote:
>>>> On 01/10/18 10:08, Jan Beulich wrote:
>>>>>>>> On 28.09.18 at 19:22, <andrew.coop...@citrix.com> wrote:
>>>>>> +static char *print_domain(char *str, char *end, const struct domain *d)
>>>>>> +{
>>>>>> +    const char *name = NULL;
>>>>>> +
>>>>>> +    /* Some debugging may have an optionally-NULL pointer. */
>>>>>> +    if ( unlikely(!d) )
>>>>>> +        return string(str, end, "NULL", -1, -1, 0);
>>>>>> +
>>>>>> +    if ( str < end )
>>>>>> +        *str = 'd';
>>>>>> +
>>>>>> +    switch ( d->domain_id )
>>>>>> +    {
>>>>>> +    case DOMID_IO:   name = "[IO]";   break;
>>>>>> +    case DOMID_XEN:  name = "[XEN]";  break;
>>>>>> +    case DOMID_COW:  name = "[COW]";  break;
>>>>>> +    case DOMID_IDLE: name = "[IDLE]"; break;
>>>>>     default: ASSERT_UNREACHABLE();
>>>>>
>>>>> ?
>>>> No - specifically not in this case.
>>>>
>>>> This path is used when printing crash information, and falling back to a
>>>> number is better behaviour than falling into an infinite loop,
>>>> overflowing the primary stack, then taking a #DF (which escalates to
>>>> triple fault on AMD), without printing anything useful.
>>> Ah, good point. Perhaps worth a brief comment instead of a "default:"
>>> then?
>> This incremental diff?
> LGTM, thanks.

I've committed this now, but its just occurred to me that we couldn't
possibly have had a default case, because that is the common case for
most domains.

~Andrew

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

Reply via email to