From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFqdn-0004gv-Se for qemu-devel@nongnu.org; Wed, 02 Dec 2009 09:57:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFqdj-0004ep-2V for qemu-devel@nongnu.org; Wed, 02 Dec 2009 09:57:15 -0500 Received: from [199.232.76.173] (port=53993 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFqdi-0004ed-OD for qemu-devel@nongnu.org; Wed, 02 Dec 2009 09:57:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5606) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFqdh-000286-Qm for qemu-devel@nongnu.org; Wed, 02 Dec 2009 09:57:10 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2Ev8Mu020937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 09:57:09 -0500 Date: Wed, 2 Dec 2009 16:54:30 +0200 From: "Michael S. Tsirkin" Message-ID: <20091202145430.GG18519@redhat.com> References: <3c7c499f0a21f08a0f5d5f1496cb3180e5a179b7.1259754427.git.quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7c499f0a21f08a0f5d5f1496cb3180e5a179b7.1259754427.git.quintela@redhat.com> Subject: [Qemu-devel] Re: [PATCH 31/41] virtio-net: we know macs size at compile time, make it static List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: markmc@redhat.com, qemu-devel@nongnu.org No objection to this or similar change with vlans, but I'd like to know why was this made a separate buffer originally. On Wed, Dec 02, 2009 at 01:04:29PM +0100, Juan Quintela wrote: > > Signed-off-by: Juan Quintela > --- > hw/virtio-net.c | 6 +----- > 1 files changed, 1 insertions(+), 5 deletions(-) > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index c515e0e..550a814 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -54,7 +54,7 @@ typedef struct VirtIONet > uint32_t first_multi; > uint8_t multi_overflow; > uint8_t uni_overflow; > - uint8_t *macs; > + uint8_t macs[MAC_TABLE_ENTRIES * ETH_ALEN]; > } mac_table; > uint8_t vlans[MAX_VLAN >> 3]; > } VirtIONet; > @@ -860,8 +860,6 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf) > n->mergeable_rx_bufs = 0; > n->promisc = 1; /* for compatibility */ > > - n->mac_table.macs = qemu_mallocz(MAC_TABLE_ENTRIES * ETH_ALEN); > - > register_savevm("virtio-net", virtio_net_id++, VIRTIO_NET_VM_VERSION, > virtio_net_save, virtio_net_load, n); > > @@ -876,8 +874,6 @@ void virtio_net_exit(VirtIODevice *vdev) > > unregister_savevm("virtio-net", n); > > - qemu_free(n->mac_table.macs); > - > qemu_del_timer(n->tx_timer); > qemu_free_timer(n->tx_timer); > > -- > 1.6.5.2