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

Re: [Xen-devel] [PATCH v5 04/10] libxl: convert libxl_device_disk_add to an asyn op



Roger Pau Monne writes ("Re: [PATCH v5 04/10] libxl: convert 
libxl_device_disk_add to an asyn op"):
> Can't we remove _init, if it's not needed? Having and _init function 
> makes people thing they have to use it, and the comments doesn't say 
> anything about _wait calling _init itself.

_init is needed to provide a way to initialise the structure so that
it is safe to pass to _cancel.  This means that caller can use
idempotent initialisation and cleanup, which avoids leaks and logic
errors.

This is the same way it's done for many other of the event functions,
eg:
    libxl__ev_FOO_{init,register,deregister}
    libxl__datacopier_{state,init,start,kill}
    libxl__bootloader_{state,init,run}

Feel free to provide a comment clarifying the API.

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