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

login
register
mail settings
Submitter Juan Quintela
Date Dec. 2, 2009, 12:04 p.m.
Message ID <fb4b2e2d4261ea8ea34971add339ea9f7cb48a57.1259754427.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/40032/
State New
Headers show

Comments

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

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);