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

Re: [Xen-devel] [PATCH 2/5] libxl: make GC_FREE reachable in libxl_get_scheduler()



On Tue, 2016-01-05 at 09:49 +0100, Dario Faggioli wrote:
> For other users, I agree that they should be handling or start to
> handle LIBXL_SCHEDULER_UNKNOWN. *Maybe*, just as a "mitigation"
> measure", we can redefine the enum and make "unknown"=-1... or is
> something like that to be considered an API change as well?

So in theory an enum can be signed per the spec (and is required to be if
any of the tags are assigned a -ve value) and it also seems like it is
signed in the ABIs we support (otherwise "sched < 0" would surely generate
warnings on some compiler).

However I don't think we want to change the value of SCHEDULER_UNKNOWN away
from 0 since we expect in many parts of the libxl API that things can be
checked for validity with ! (e.g. if (!sched) barf()) I haven't looked at
whether anyone does in this specific case.

I spoke with Ian J IRL and he suggested that libxl_get_scheduler should
probably return an explicit int, which can contain either the (negative)
libxl ERROR_* constants or the (positive) values of libxl_scheduler.

As far as we can tell there are no worry ABI or API considerations from
such a change (there are corner cases, such as function pointers no longer
being seen as compatible, but we think those won't be an issue in this
case).

Ian.


_______________________________________________
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®.