From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: libxl_device handling for nic and vtmp Date: Thu, 18 Feb 2016 17:25:56 +0000 Message-ID: <20160218172556.GL3723@citrix.com> References: <20160218151321.GA10541@aepfle.de> <20160218155219.GA7186@citrix.com> <20160218165438.GA1394@aepfle.de> <20160218170235.GB24938@citrix.com> <20160218171907.GA9285@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20160218171907.GA9285@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Feb 18, 2016 at 06:19:07PM +0100, Olaf Hering wrote: > On Thu, Feb 18, Wei Liu wrote: > > > Sorry I don't follow. What do you mean by 1:1 copy? Why does it make the > > update unnecessary? > > The current code does: > > libxl_device_nic_init(&nic_saved); > libxl_device_nic_copy(CTX, &nic_saved, nic); > nic->devid = libxl__device_nextid(gc, domid, "vif"); > libxl__update_config_nic(gc, &nic_saved, nic); > > Which is equivalent to the more obvious version: > > libxl_device_nic_init(&nic_saved); > nic->devid = libxl__device_nextid(gc, domid, "vif"); > libxl_device_nic_copy(CTX, &nic_saved, nic); > > The input gets modified either way. Is it expected that future versions > of libxl_device_nic/vtmp_copy will not duplicate the mac/uuid parts? > You missed libxl__device_nic_setdefault -- it changes fields in the structure. Wei. > > Olaf