qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 1/4] net: update nic info during device reset


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PULL 1/4] net: update nic info during device reset
Date: Fri, 18 Oct 2013 15:35:11 +0200

From: Amos Kong <address@hidden>

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

Signed-off-by: Amos Kong <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 hw/net/e1000.c   | 1 +
 hw/net/rtl8139.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 151d25e..9a1c46e 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -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
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index c31199f..9b4a650 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -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;
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]