From: Ian Jackson Subject: Re: [PATCH 1/3] libxl, xl: don't init/dispose when not necessary Date: Tue, 10 Feb 2015 10:54:47 +0000 Message-ID: <21721.58231.791546.413355@mariner.uk.xensource.com> References: <1423488068-31268-1-git-send-email-wei.liu2@citrix.com> <1423488068-31268-2-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: <1423488068-31268-2-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: Wei Liu Cc: jfehlig@suse.com, Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Wei Liu writes ("[PATCH 1/3] libxl, xl: don't init/dispose when not necessary"): > Functions like libxl__device_disk_from_xs_be and > libxl_vdev_to_device_disk should not touch the disk struct passed in. > It's caller's responsibility to do that. ... > Note that libxl_vdev_to_device_disk is a public API so a macro is > defined in libxl.h to indicate the change of behaviour. I don't think this is really on, in the public API. Why not make libxl_..._free idempotent ? Then extra calls to _init are harmless. Ian.