virtio-net: don't update mac_table in error state
commitcae2e5562cdaf3aafa1c4ec2d5f2b19af6c886dd
authorAmos Kong <akong@redhat.com>
Mon, 11 Nov 2013 03:48:36 +0000 (11 11:48 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 9 Dec 2013 12:33:20 +0000 (9 13:33 +0100)
tree2594c16a8ec73e2452131e6d8c3704daa5cf8e5d
parentaee09baf915491eabbf46f9cf55a445ec59b8269
virtio-net: don't update mac_table in error state

mac_table was always cleaned up first in handling
VIRTIO_NET_CTRL_MAC_TABLE_SET command, and we din't recover
mac_table content in error state, it's not correct.

This patch makes all the changes in temporal variables,
only update the real mac_table if everything is ok.
We won't change mac_table in error state, so rxfilter
notification isn't needed.

This patch also fixed same problame in
 http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg01188.html
 (not merge)

I will send patch for virtio spec to clarifying this change.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Vlad Yasevich <vyasevic@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/virtio-net.c