]> git.proxmox.com Git - qemu.git/commitdiff
net: update nic info during device reset
authorAmos Kong <akong@redhat.com>
Thu, 17 Oct 2013 08:38:34 +0000 (16:38 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 18 Oct 2013 11:28:09 +0000 (13:28 +0200)
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>
hw/net/e1000.c
hw/net/rtl8139.c

index 151d25e0b7e4f3f9c3cb8a629d3abbeb9efa84b2..9a1c46e8caebb297b927da56735e8f08d589f74c 100644 (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
index c31199f8c8339ad16ae80724e0a5d329beb40b5c..9b4a6501d76d2a05712745d7a56da798d77a301d 100644 (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;