|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-API] Xen-API Weekly Call, 12 June 2006, Minutes
Ewan Mellor wrote: Xen-API Weekly Call, 12 June 2006, Minutes ========================================== [snip]
The binding can't decide how to allocate the structs if at the same time the client is filling them out on create. Perhaps we should do a create in steps, passing params at each step and getting back a structure allocated by the binding for use in the next step. E.g. xen_vbd_create(some, params), xen_vif_create(some, params), etc. whose return values will be used in xen_vm_create(). The API should be symmetric wrt memory allocation, not client handles memory of structs for some calls but binding handles it for others. BTW, libvirt currently does use an XML string for config on create. I mentioned that it would be nice to use structs so client would not be burdened with parsing / creating XML. It has not been done in libvirt yet due to lack of standard interface :-). There was discussion of the way that Sets are handled in the interface. Daniel said that he did not like the fact that Sets are returned as a malloc()d array by the API, with the caller expected to free() that array later. He would rather that the caller could allocate space for the array, and then pass this space into the API in order to be filled. This would allow the caller to allocate memory in any way they chose, including on the stack. Ewan pointed out that this leaves you with a race condition, whereby you make a call to find out how big the array has to be, but then this subsequently changes, causing you to have to retry. A solution that all are happy with was not found. If we go with "binding decides how to allocate handles" concept above, why not here as well? But if caller provides memory, maybe the function can take a 'hasMore' parameter that would be set if caller-provided buffer was insufficient to contain all set members. Jim _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |