From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 4 of 4] xl: Add pci_assignable_add and remove commands Date: Fri, 11 May 2012 13:50:57 +0100 Message-ID: <4FAD0B31.3010608@eu.citrix.com> References: <1336649508.7098.97.camel@zakaz.uk.xensource.com> <4FACF443.5080002@eu.citrix.com> <1336735163.23818.72.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1336735163.23818.72.camel@zakaz.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: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 11/05/12 12:19, Ian Campbell wrote: > On Fri, 2012-05-11 at 12:13 +0100, George Dunlap wrote: >>>> + >>>> +static void pciassignable_remove(const char *bdf, int rebind) >>>> +{ >>>> + libxl_device_pci pcidev; >>>> + XLU_Config *config; >>>> + >>>> + memset(&pcidev, 0x00, sizeof(pcidev)); >>> libxl_device_pci_init also. >>> >>> You are also missing the xlu_cfg_destroy both here and in the add fn. >>> >>> (it's a bit annoying that an XLU_COnfig is needed for these simple >>> helper functions, I suppose it's for logging, but maybe they could log >>> to stderr if cfg==NULL. Anyway, lets not fix that here) >> Hmm -- I just copied and pasted from pciattach() and friends. I'll fix >> those up while I'm at it. > Thanks, looked like my grep missed them somehow when I added the init > fns. The reset of the memset's in xl_cmdimpl.c look ok except for: > > memset(cpumap.map, 0, cpumap.size); > > in main_cpupoolnumasplit which smells a bit fishy -- I'll investigate > that one... OK -- I found another place xl_cfg_destroy() wasn't being called. I think I'll send those as a separate clean-up series; but the new functions added in the series will have the fixes you suggested. -George