@@ -20,6 +20,8 @@
#define VIRTIO_NET_VM_VERSION 11
+/* MAC_TABLE_ENTRIES can only grow, you can't make it smaller, or you
+ broke VMState backward compatiblity */
#define MAC_TABLE_ENTRIES 64
#define MAX_VLAN (1 << 12) /* Per 802.1Q definition */
@@ -740,15 +742,8 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
if (version_id >= 5) {
n->mac_table.in_use = qemu_get_be32(f);
- /* MAC_TABLE_ENTRIES may be different from the saved image */
- if (n->mac_table.in_use <= MAC_TABLE_ENTRIES) {
- qemu_get_buffer(f, n->mac_table.macs,
- n->mac_table.in_use * ETH_ALEN);
- } else if (n->mac_table.in_use) {
- qemu_fseek(f, n->mac_table.in_use * ETH_ALEN, SEEK_CUR);
- n->mac_table.multi_overflow = n->mac_table.uni_overflow = 1;
- n->mac_table.in_use = 0;
- }
+ qemu_get_buffer(f, n->mac_table.macs,
+ n->mac_table.in_use * ETH_ALEN);
}
if (version_id >= 6)
Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/virtio-net.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-)