From: Ian Jackson Subject: Re: [PATCH] libxl: Auto-assign NIC devids in initiate_domain_create Date: Thu, 9 Jan 2014 15:04:26 +0000 Message-ID: <21198.47738.357463.155514@mariner.uk.xensource.com> References: <1389263589-11955-1-git-send-email-stefan.bader@canonical.com> <1389265395.27473.69.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1389265395.27473.69.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: jfehlig@suse.com, Stefan Bader , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH] libxl: Auto-assign NIC devids in initiate_domain_create"): > On Thu, 2014-01-09 at 11:33 +0100, Stefan Bader wrote: > > From bafc8f62ee3e3175ec4d978bceba4b5f891a597d Mon Sep 17 00:00:00 2001 > > From: Stefan Bader > > Date: Wed, 8 Jan 2014 18:26:59 +0100 > > Subject: [PATCH] libxl: Auto-assign NIC devids in initiate_domain_create > > > > This will change initiate_domain_create to walk through NIC definitions > > and automatically assign devids to those which have not assigned one. > > The devids are needed later in domcreate_launch_dm (for HVM domains > > using emulated NICs). The command string for starting the device-model > > has those ids as part of its arguments. > > Assignment of devids in the hotplug case is handled by libxl_device_nic_add > > but that would be called too late in the startup case. > > I also moved the call to libxl__device_nic_setdefault here as this seems > > to be the only path leading there and avoids doing the loop a third time. > > The two loops are trying to handle a case where the caller sets some devids > > (not sure that should be valid) but leaves some unset. Thanks. Thanks also for the careful and comprehensive explanation. > > Signed-off-by: Stefan Bader > > Acked-by: Ian Campbell Acked-by: Ian Jackson > I think from a release point of view we should take this since it is a > bug fix to the API which at least libvirt has tripped over (although > libvirt has worked around it, others may not have done so). > Ian J: Does that make sense? I agree. Thanks, Ian.