net: update nic info during device reset

macaddr is reset during device reset, but nic info
isn't updated, this problem exists in e1000 & rtl8139

Signed-off-by: Amos Kong <akong@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Amos Kong 2013-10-17 16:38:34 +08:00 committed by Stefan Hajnoczi
parent 1680d48577
commit 655d3b63b0
2 changed files with 2 additions and 0 deletions

View File

@ -401,6 +401,7 @@ static void e1000_reset(void *opaque)
d->mac_reg[RA] |= macaddr[i] << (8 * i);
d->mac_reg[RA + 1] |= (i < 2) ? macaddr[i + 4] << (8 * i) : 0;
}
qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
}
static void

View File

@ -1214,6 +1214,7 @@ static void rtl8139_reset(DeviceState *d)
/* restore MAC address */
memcpy(s->phys, s->conf.macaddr.a, 6);
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
/* reset interrupt mask */
s->IntrStatus = 0;