On 20 May 2011 17:07, Jan Kiszka <jan.kis...@siemens.com> wrote: > On 2011-05-20 18:04, Peter Maydell wrote: >> I think that avoiding MAC address clashes should be done by >> having net_init_nic() call qemu_macaddr_default_if_unset() > > You mean qemu_new_nic? Otherwise it wouldn't help. Will have a look to > move that over.
No, I mean net_init_nic(). At the moment there are two bits of code which generate a fresh MAC address: 1. qemu_macaddr_default_if_unset() -- init routines for qdev network devices call this 2. net_init_nic() -- devices created via -net nic get their MAC address assigned here; if the underlying device is qdev then by the time the qdev init routine is called the macaddr is already set so it isn't overridden So if the code in 2. calls qemu_macaddr_default_if_unset instead then we only have one function with a static variable which doles out autogenerated MAC addresses. -- PMM