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

Re: [Xen-devel] [PATCH v3] xen/errno: Reduce complexity of inclusion



>>> On 04.03.16 at 13:50, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 04/03/16 12:28, Jan Beulich wrote:
>>>>> On 04.03.16 at 13:24, <JBeulich@xxxxxxxx> wrote:
>>>>>> On 03.03.16 at 15:14, <andrew.cooper3@xxxxxxxxxx> wrote:
>>>> @@ -82,16 +109,19 @@ XEN_ERRNO(EISCONN,    106)    /* Transport endpoint 
>>>> is already 
>>> connected */
>>>>  XEN_ERRNO(ENOTCONN,       107)    /* Transport endpoint is not connected 
>>>> */
>>>>  XEN_ERRNO(ETIMEDOUT,      110)    /* Connection timed out */
>>>>  
>>>> -#undef XEN_ERRNO
>>>>  #endif /* XEN_ERRNO */
>>>> -
>>>> -#ifndef __XEN_PUBLIC_ERRNO_H__
>>>> -#define __XEN_PUBLIC_ERRNO_H__
>>>> -
>>>>  /* ` } */
>>>>  
>>>> +
>>>> +/*
>>>> + * Clean up from a default include.  Close the enum (for C) and remove the
>>>> + * default XEN_ERRNO from scope.
>>>> + */
>>>> +#ifdef XEN_ERRNO_DEFAULT_INCLUDE
>>>> +#undef XEN_ERRNO_DEFAULT_INCLUDE
>>>> +#undef XEN_ERRNO
>>>>  #ifndef __ASSEMBLY__
>>>>  };
>>>>  #endif
>>>>  
>>>> -#endif /*  __XEN_PUBLIC_ERRNO_H__ */
>>>> +#endif /* XEN_ERRNO_DEFAULT_INCLUDE */
>>> So far, upon reaching the end oft the file XEN_ERRNO is undefined,
>>> no matter whether it got defined here or prior to inclusion. I think
>>> this property should be retained, but moving the #undef to the
>>> very end.
>> Or rather not removing it from where it's now.
> 
> IMO, it is wrong to undef XEN_ERRNO if it was provided from external scope.

Well, even if not written down, that's the intended behavior: The
use case for the including file to further need that definition is
rather hard to see, whereas use cases for the including file
wanting to do multiple inclusion are quite easy to construct, and
in that case the including file would needlessly be forced to
repeatedly #undef the symbol.

> The only users of this "custom" include in Xen itself, and shortly,
> hvmloader.

The only users you know of. I'm definitely having plans to make
Linux use it too, to have a build time check that the errno values
continue to be in sync.

> I think it is fine as-is.

I could use the same words, just for the unpatched file: I don't
really agree with this part of your change.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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