diff mbox

[26/41] virtio-net: we know vlans size at compile time, make it static

Message ID fb4b2e2d4261ea8ea34971add339ea9f7cb48a57.1259754427.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Dec. 2, 2009, 12:04 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/virtio-net.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index e5c6ea0..97db0d0 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -56,7 +56,7 @@  typedef struct VirtIONet
         uint8_t uni_overflow;
         uint8_t *macs;
     } mac_table;
-    uint32_t *vlans;
+    uint32_t vlans[MAX_VLAN >> 5];
 } VirtIONet;

 /* TODO
@@ -846,8 +846,6 @@  VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf)

     n->mac_table.macs = qemu_mallocz(MAC_TABLE_ENTRIES * ETH_ALEN);

-    n->vlans = qemu_mallocz(MAX_VLAN >> 3);
-
     register_savevm("virtio-net", virtio_net_id++, VIRTIO_NET_VM_VERSION,
                     virtio_net_save, virtio_net_load, n);

@@ -863,7 +861,6 @@  void virtio_net_exit(VirtIODevice *vdev)
     unregister_savevm("virtio-net", n);

     qemu_free(n->mac_table.macs);
-    qemu_free(n->vlans);

     qemu_del_timer(n->tx_timer);
     qemu_free_timer(n->tx_timer);