cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From c3ceee56d6d43cd234fcc297b802d68a53b3a12a Mon Sep 17 00:00:00 2001
218e99
From: Amos Kong <akong@redhat.com>
218e99
Date: Tue, 5 Nov 2013 09:17:39 +0100
218e99
Subject: [PATCH 07/25] net: update nic info during device reset
218e99
218e99
RH-Author: Amos Kong <akong@redhat.com>
218e99
Message-id: <1383643062-1844-2-git-send-email-akong@redhat.com>
218e99
Patchwork-id: 55368
218e99
O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/4] net: update nic info during device reset
218e99
Bugzilla: 922589
218e99
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
218e99
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
218e99
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
218e99
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
218e99
218e99
Bugzilla: 922589
218e99
218e99
macaddr is reset during device reset, but nic info
218e99
isn't updated, this problem exists in e1000 & rtl8139
218e99
218e99
Signed-off-by: Amos Kong <akong@redhat.com>
218e99
Acked-by: Michael S. Tsirkin <mst@redhat.com>
218e99
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
218e99
(cherry picked from commit 655d3b63b036b70714adbdae685055f1bda0f8f1)
218e99
---
218e99
 hw/net/e1000.c   |    1 +
218e99
 hw/net/rtl8139.c |    1 +
218e99
 2 files changed, 2 insertions(+), 0 deletions(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 hw/net/e1000.c   |    1 +
218e99
 hw/net/rtl8139.c |    1 +
218e99
 2 files changed, 2 insertions(+), 0 deletions(-)
218e99
218e99
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
218e99
index a813523..d273ef2 100644
218e99
--- a/hw/net/e1000.c
218e99
+++ b/hw/net/e1000.c
218e99
@@ -315,6 +315,7 @@ static void e1000_reset(void *opaque)
218e99
         d->mac_reg[RA] |= macaddr[i] << (8 * i);
218e99
         d->mac_reg[RA + 1] |= (i < 2) ? macaddr[i + 4] << (8 * i) : 0;
218e99
     }
218e99
+    qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
218e99
 }
218e99
 
218e99
 static void
218e99
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
218e99
index 8f20ef4..3ff5518 100644
218e99
--- a/hw/net/rtl8139.c
218e99
+++ b/hw/net/rtl8139.c
218e99
@@ -1202,6 +1202,7 @@ static void rtl8139_reset(DeviceState *d)
218e99
 
218e99
     /* restore MAC address */
218e99
     memcpy(s->phys, s->conf.macaddr.a, 6);
218e99
+    qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
218e99
 
218e99
     /* reset interrupt mask */
218e99
     s->IntrStatus = 0;
218e99
-- 
218e99
1.7.1
218e99