Re: [Xen-devel] [PATCH v4 2/2] libxl: made vm mac address assignment deterministic

2018-09-20 Thread Wei Liu
On Wed, Sep 12, 2018 at 05:40:37PM +, Joshua Perrett wrote: [...] > +int libxl__get_host_mac(libxl__gc *gc, unsigned char *buf) > +{ > +int rc = ERROR_FAIL; > + > +struct ifaddrs *iface_list; > +uint8_t largest[6] = {0}; > + > +if (getifaddrs(&iface_list) == 0) { > +for

[Xen-devel] [PATCH v4 2/2] libxl: made vm mac address assignment deterministic

2018-09-12 Thread Joshua Perrett
Uses MD5 on a host mac address, the vm name and vif index to generate the last three bytes of the vm mac address (for each vm). It uses the vif index to account for multiple vifs. Reported-by: George Dunlap Signed-off-by: Joshua Perrett --- tools/libxl/Makefile | 2 +- tools/libxl/libx