mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
net: Consistently use qemu_macaddr_default_if_unset
Drop the open-coded MAC assignment from net_init_nic and replace it with standard qemu_macaddr_default_if_unset which is also used by qdev. That avoid creating colliding MACs when instantiating NICs via different mechanisms. This change requires to store the MAC as MACAddr in NICInfo, and the remaining nd_table users need to be updated. Based on suggestion by Peter Maydell. CC: Markus Armbruster <armbru@redhat.com> CC: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
44e798d395
commit
6eed18568d
9 changed files with 11 additions and 17 deletions
|
@ -258,7 +258,7 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd)
|
|||
s->irq = irq;
|
||||
|
||||
if (nd) {
|
||||
memcpy(s->conf.macaddr.a, nd->macaddr, sizeof(nd->macaddr));
|
||||
s->conf.macaddr = nd->macaddr;
|
||||
s->conf.vlan = nd->vlan;
|
||||
s->conf.peer = nd->netdev;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue