From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH V5 07/32] libxl.h: document the paradigm of using libxl types Date: Tue, 13 May 2014 22:53:49 +0100 Message-ID: <1400018054-26038-8-git-send-email-wei.liu2@citrix.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Wei Liu , ian.jackson@eu.citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Signed-off-by: Wei Liu --- tools/libxl/libxl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 31877da..303bd71 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -240,6 +240,16 @@ * libxl_types.idl). The library provides a common set of methods for * initialising and freeing these types. * + * IDL-generated libxl types should be used as follows: the user must + * always call the "init" function before using a type, even if the + * variable is simply being passed by reference as an out parameter + * to a libxl function. The user must always calls "dispose" exactly + * once afterwards, to clean up, regardless of whether operations on + * this object succeeded or failed. See the xl code for examples. + * + * "init" is idempotent. We intend that "dispose" will become + * idempotent, but this is not currently the case. + * * void libxl__init( *p): * * Initialises the members of "p" to all defaults. These may either -- 1.7.10.4