Blob Blame History Raw
From 418947bb253989027df4db46253287436792abd9 Mon Sep 17 00:00:00 2001
From: Amos Kong <akong@redhat.com>
Date: Tue, 5 Nov 2013 09:17:42 +0100
Subject: [PATCH 10/25] virtio-net: fix up HMP NIC info string on reset

RH-Author: Amos Kong <akong@redhat.com>
Message-id: <1383643062-1844-5-git-send-email-akong@redhat.com>
Patchwork-id: 55371
O-Subject: [RHEL-7.0 qemu-kvm PATCH 4/4] virtio-net: fix up HMP NIC info string on reset
Bugzilla: 1026689
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>

From: Michael S. Tsirkin <mst@redhat.com>

Bugzilla: 1026689

When mac is updated on reset, info string has stale data.
Fix it up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 702d66a813dd84afd7c3d1ad8cbdcc8e3449bcd9)
---
 hw/net/virtio-net.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/net/virtio-net.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 9ebcdfe..3290013 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -213,6 +213,7 @@ static void virtio_net_reset(VirtIODevice *vdev)
     n->mac_table.uni_overflow = 0;
     memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN);
     memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac));
+    qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
     memset(n->vlans, 0, MAX_VLAN >> 3);
 }
 
-- 
1.7.1