On 08.05.2024 13:04, Matthew Barnes wrote:
> @@ -24,7 +25,18 @@ int main(int argc, char **argv)
>          status.port = port;
>          rc = xc_evtchn_status(xch, &status);
>          if ( rc < 0 )
> -            break;
> +        {
> +            if ( errno == ESRCH )
> +            {
> +                fprintf(stderr, "Domain ID '%d' does not correspond to valid 
> domain.\n", domid);
> +                break;
> +            }
> +
> +            if ( errno == EINVAL )
> +                break;
> +
> +            continue;
> +        }

Hmm, I'm not sure "black listing" certain error codes is useful. I'd have
expected a "white listing" approach, special casing just EACCES and EPERM
(which iirc is what XSM would return). I'm also not convinced of the
error message text of the ESRCH case you special case: There are valid
domain IDs which still cannot be used with rcu_lock_domain_by_any_id(),
e.g. DOM_IO and DOM_XEN.

I'd be curious to hear what others think.

Andrew, ftaod - this is the patch I've mentioned in reply to your revert
touching evtchn_status(). And as mentioned there - lsevtchn should never
have outright bailed on _any_ error it gets back (i.e. even ones coming
from XSM).

Jan

Reply via email to