From: Ian Jackson Subject: Re: [PATCH v1 08/12] libxl: add disk specific remove functions Date: Wed, 13 Mar 2013 16:22:25 +0000 Message-ID: <20800.42945.866350.396411@mariner.uk.xensource.com> References: <1358963317-10221-1-git-send-email-roger.pau@citrix.com> <1358963317-10221-9-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-9-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 08/12] libxl: add disk specific remove functions"): > Add a specific macro to generate libxl_device_disk_{remove/destroy} > functions that passes the hotplug_version field down to the aodev > struct. > +/* Specific for disk devices, that have to set aodev->hotplug_version */ > +#define DEFINE_DISK_REMOVE(type, removedestroy, f) \ > + int libxl_device_##type##_##removedestroy(libxl_ctx *ctx, \ This macro is very similar to DEFINE_DEVICE_REMOVE. The only difference seems to be these extra lines: > + aodev->hotplug.version = type->hotplug_version; \ > + LOG(DEBUG, "hotplug version: %d", aodev->hotplug.version); \ > + libxl__initiate_device_remove(egc, aodev); \ Perhaps the right answer would be to add a new formal parameter to DEFINE_DEVICE_REMOVE which allows DEFINE_DEVICE_REMOVE's user to specify some extra code here ? Ian.