From: Ian Jackson Subject: Re: [PATCH v1 06/12] libxl: add support for different hotplug interfaces Date: Wed, 13 Mar 2013 16:17:08 +0000 Message-ID: <20800.42628.553623.496721@mariner.uk.xensource.com> References: <1358963317-10221-1-git-send-email-roger.pau@citrix.com> <1358963317-10221-7-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1358963317-10221-7-git-send-email-roger.pau@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: Roger Pau Monne Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[Xen-devel] [PATCH v1 06/12] libxl: add support for different hotplug interfaces"): > Add a new variable to libxl_device_disk "hotplug_version", that will > be automatically set to the detected hotplug script interface version. ... > + /* > + * We might have devices that have been prepared, but with no > + * frontend xenstore entries, so domain destruction fails to > + * find them, that is why we have to unprepare them manually. > + */ > + libxl__multidev_begin(ao, &dcs->multidev); > + dcs->multidev.callback = domcreate_unprepare_cb; > + libxl__unprepare_disks(egc, ao, domid, d_config, &dcs->multidev); > + libxl__multidev_prepared(egc, &dcs->multidev, 0); > + return; I don't think this is correct. What if the calling application crashes and this code is never executed ? Then libxl_destroy would leak this state. So I think you need to record the preparedness somewhere where libxl_destroy can find it. Ian.