From: Ian Jackson Subject: Re: [PATCH v1 06/12] libxl: synchronize device removal when using driver domains Date: Fri, 1 Nov 2013 18:48:12 +0000 Message-ID: <21107.63340.961427.521493@mariner.uk.xensource.com> References: <1380705874-58491-1-git-send-email-roger.pau@citrix.com> <1380705874-58491-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: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VcJla-00064c-7p for xen-devel@lists.xenproject.org; Fri, 01 Nov 2013 18:48:18 +0000 In-Reply-To: <1380705874-58491-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: xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH v1 06/12] libxl: synchronize device removal when using driver domains"): > Synchronize the clean up of the backend from the toolstack domain when > the driver domain has actually finished closing the backend for the > device. > > This is accomplished by waiting for the driver domain to remove the > directory containing the backend keys, then the toolstack domain will > finish the cleanup by removing the empty folders on the backend path. ... This is broadly speaking good. I have one suggestion: > +static void device_destroy_be_timeout_cb(libxl__egc *egc, libxl__ev_time *ev, > + const struct timeval *requested_abs) > +{ ... > + libxl__ev_time_deregister(gc, &aodev->timeout); > + libxl__ev_xswatch_deregister(gc, &aodev->xs_watch); ... > + device_hotplug_done(egc, aodev); You might consider moving those two idemopotent cleanup calls into device_hotplug_done, which is on all the outward paths from here. That reduces the number of times you have to write them from two to one. Ian.