[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 3/3] libxl: ocaml: use 'for_app_registration' in osevent callbacks
On Thu, 2013-12-12 at 21:27 +0000, Rob Hoes wrote: > > If it indicates an error in the caller of the bindings or something > > which can happen for some reason unrelated to the code itself (e.g some > > external circumstance) then the error return would be appropriate. > > For the modify and deregister functions, Iâd consider it a programming > error if for_app is NULL (either in the bindings or libxl itself). > This is because the register functions will always get a value passed > in from the OCaml app (even if it is just a unit â()â), and this value > is expected to be delivered to subsequent (related) modify or > deregister calls. > > Following your reasoning, we should use an assert for this. Agreed. > For the register functions, for_app_registration_out is NULL on entry > (according to libxl_event.h), but this is ignored by the bindings. > There is an âif (for_app)â there to check the outcome of malloc. If > malloc returns NULL, then the second category applies (external > circumstance). According to the docs, a registration of modification > hook may return ERROR_OSEVENT_REG_FAIL or any positive int in case it > fails, which seems appropriate there. Right, I should have been clearer that I was talking about the other case and not the allocation failures. > Iâll update the patch. Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |