Re: [Xen-devel] libxl_device handling for nic and vtmp

2016-02-18 Thread Wei Liu
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,

Re: [Xen-devel] libxl_device handling for nic and vtmp

2016-02-18 Thread Olaf Hering
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"); libx

Re: [Xen-devel] libxl_device handling for nic and vtmp

2016-02-18 Thread Wei Liu
On Thu, Feb 18, 2016 at 05:54:38PM +0100, Olaf Hering wrote: > On Thu, Feb 18, Wei Liu wrote: > > > For example, user might not have specified mac address so the library > > generates one for (s)he. You don't want mac address to regenerate after > > save / restore or migration. But you don't want

Re: [Xen-devel] libxl_device handling for nic and vtmp

2016-02-18 Thread Olaf Hering
On Thu, Feb 18, Wei Liu wrote: > For example, user might not have specified mac address so the library > generates one for (s)he. You don't want mac address to regenerate after > save / restore or migration. But you don't want to preserve all > autogenerated state, so you use the original copy as

Re: [Xen-devel] libxl_device handling for nic and vtmp

2016-02-18 Thread Wei Liu
On Thu, Feb 18, 2016 at 04:13:21PM +0100, Olaf Hering wrote: > What is the point of libxl__update_config_nic and > libxl__update_config_vtmp? > > In libxl__device_type_add (called from DEFINE_DEVICE_ADD) the input > type is copied with libxl_device_type_copy to type_saved, which is a > 1:1 copy. I

[Xen-devel] libxl_device handling for nic and vtmp

2016-02-18 Thread Olaf Hering
What is the point of libxl__update_config_nic and libxl__update_config_vtmp? In libxl__device_type_add (called from DEFINE_DEVICE_ADD) the input type is copied with libxl_device_type_copy to type_saved, which is a 1:1 copy. If needed, a new devid is assigned to the input. Later the copy is updated