From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 --for 4.6 COLOPre 25/25] tools/libxl: seperate device init/cleanup from checkpoint device layer Date: Wed, 15 Jul 2015 14:37:58 +0100 Message-ID: <1436967478.32371.70.camel@citrix.com> References: <1436946351-21118-1-git-send-email-yanghy@cn.fujitsu.com> <1436946351-21118-26-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436946351-21118-26-git-send-email-yanghy@cn.fujitsu.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: Yang Hongyang Cc: wei.liu2@citrix.com, eddie.dong@intel.com, wency@cn.fujitsu.com, andrew.cooper3@citrix.com, yunhong.jiang@intel.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, guijianfeng@cn.fujitsu.com, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On Wed, 2015-07-15 at 15:45 +0800, Yang Hongyang wrote: > we call (init|cleanup)_subkind_nic and (init|cleanup)_subkind_drbd_disk > directly in checkpoint device. Move them to libxl_remus.c, Call them before > calling libxl__checkpoint_devices_setup() or after calling > libxl__checkpoint_devices_teardown(). > it is pure refactoring and no functional changes. > > Signed-off-by: Wen Congyang > Signed-off-by: Yang Hongyang Acked-by: Ian Campbell > @@ -86,14 +54,10 @@ static void checkpoint_devices_setup(libxl__egc *egc, > void libxl__checkpoint_devices_setup(libxl__egc *egc, > libxl__checkpoint_devices_state *cds) > { > - int i, rc; > + int i; > > STATE_AO_GC(cds->ao); > > - rc = init_device_subkind(cds); > - if (rc) > - goto out; > - > cds->num_devices = 0; > cds->num_nics = 0; > cds->num_disks = 0; > @@ -126,7 +90,7 @@ void libxl__checkpoint_devices_setup(libxl__egc *egc, > return; > > out: > - cds->callback(egc, cds, rc); > + cds->callback(egc, cds, 0); This change highlights a slightly odd (non-error) flow of code when there are no NICs or disks. I think having remus_devices_setup (with its new name) handle by passing its operation and calling all_devices_setup_cb directly if there are no devices would be more natural. A cleanup for another time though.