|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 23/28] libxl: ocaml: allow device operations to be called asynchronously
> libxl.h says:
> * *ao_how does not need to remain valid after the initiating function
> * returns. All other parameters must remain valid for the lifetime of
> * the asynchronous operation, unless otherwise specified.
>
> So the ao_how can just be a normal stack variable if you like. If you want to
> use NULL/non-NULL-ness to indicate Some/None then:
> struct ao_how aoh_struct, *aoh = NULL;
> if (async != Val_none)
> aoh = &aoh_struct
> works I think or just
> struct ao_how aoh = { .callback = async_callback, ... };
>
> ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info,
> \
> async != Val_none ? &aoh : NULL would
> do.
>
Ok, that makes sense. I have changed it to the second option.
Cheers,
Rob
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |