Skip to content

Commit

Permalink
net: update nic info during device reset
Browse files Browse the repository at this point in the history
macaddr is reset during device reset, but nic info
isn't updated, this problem exists in e1000 & rtl8139

Signed-off-by: Amos Kong <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
amoskong authored and stefanhaRH committed Oct 18, 2013
1 parent 1680d48 commit 655d3b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/net/e1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions hw/net/rtl8139.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 655d3b6

Please sign in to comment.