From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH v2 2/7] libxl: add new hotplug interface support to hotplug script callers Date: Fri, 12 Apr 2013 15:51:40 +0200 Message-ID: <5168116C.7060509@citrix.com> References: <1363607231-35228-1-git-send-email-roger.pau@citrix.com> <1363607231-35228-3-git-send-email-roger.pau@citrix.com> <20838.58843.639724.560320@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20838.58843.639724.560320@mariner.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 Jackson Cc: Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 11/04/13 18:33, Ian Jackson wrote: > Roger Pau Monne writes ("[Xen-devel] [PATCH v2 2/7] libxl: add new hotplug interface support to hotplug script callers"): >> +This document specifies the new libxl hotplug interface. This new >> +interface has been designed to operate better with complex hotplug >> +scripts, that need to perform several operations and can take a >> +considerable time to execute. >> + >> +Hotplug scripts are expected to take a parameter, passed by the caller >> +and provide a block device as output, that will be attached to the guest. > >> +PREPARE >> +------- >> + >> +This is the first operation that the hotplug script will be requested to >> +execute. This operation is executed before the disk is connected, to >> +give the hotplug script the chance to offload some work from the "add" >> +operation, that is performed later. > > But in fact in your implementation this is only called right before > add, isn't it ? It depends on the caller, for example if using libxl_device_disk_add, libxl will take care of calling prepare before add (so external API is not changed), on the other hand, when creating a new domain, the prepare functions will be called much before calling add, so we can prepare the device before the domain is paused when doing migration. If you take a look at patch 3/7, you will see that on domain create disks are prepared at initiate_domain_create. > > Also, IIRC part of the point of this new interface is that for target > devices which can't be accessed simultaneously from different hosts, > during migration you'd be able to do costly setup during the initial > part of the migration and merely "activate" the devices later. Yes, that's right, prepare will be called while the domain is still running on the sender side, so we can offload as much work as possible to this phase. > Am I missing something ? > > Thanks, > Ian. >