From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH v1 04/10] libxl: separate device add/rm complete callbacks Date: Wed, 16 Jul 2014 17:48:29 +0100 Message-ID: <20140716164829.GD4913@zion.uk.xensource.com> References: <1405002745-5034-1-git-send-email-wei.liu2@citrix.com> <1405002745-5034-5-git-send-email-wei.liu2@citrix.com> <1405527980.1087.66.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1405527980.1087.66.camel@kazak.uk.xensource.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: Ian Campbell Cc: ian.jackson@eu.citrix.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Jul 16, 2014 at 05:26:20PM +0100, Ian Campbell wrote: > On Thu, 2014-07-10 at 15:32 +0100, Wei Liu wrote: > > This is in preparation for device hotplug / unplug configuration > > synchronisation. No functional change introduced. This change is > > necessary because we need to do different things for add and remove. > > Using a single callback won't meet our need anymore. > > Looking at the next two patches it seems like this is because on add you > do it at the start and on rm you do it at the end? > > I did wonder if it was possible that you could continue to share the > same callback if you could add a flag, but the real reason for not > sharing is that the code you want to add to the remove case is device > type specific, so you need multiple rm callbacks. I misunderstood your Yes, RM is type specific, hence this change. I shall write this in commit message, replacing "do different things" to make it clearer. > comment about a single callback to mean a single add+rm callback as > opposed to a single vs. multiple rm callbacks. > > Given that the actual implementation looks ok to me. > > > +DEFINE_DEVICE_RM_AOCOMPLETE(vtpm); > > +DEFINE_DEVICE_RM_AOCOMPLETE(nic); > > +DEFINE_DEVICE_RM_AOCOMPLETE(disk); > > +DEFINE_DEVICE_RM_AOCOMPLETE(vfb); > > +DEFINE_DEVICE_RM_AOCOMPLETE(vkb); > > Elsewhere in this file there is: > /* disk */ > DEFINE_DEVICE_REMOVE(disk, remove, 0) > DEFINE_DEVICE_REMOVE(disk, destroy, 1) > ... > > Perhaps add this call there too? Also that place has a comment with the > resulting function names to serve as grep fodder. That would be nice > here too. > Will do. Wei. > Ian. >