[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


  • To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
  • From: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • Date: Tue, 23 Apr 2013 16:59:36 +0100
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 23 Apr 2013 16:00:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac42s1oPCVJLNBAuQ7Wptk/bkdPmygJiA8Jw
  • Thread-topic: [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


 


Rackspace

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