Received: from eggs.gnu.org ([2001:4830:134:3::10]:45113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uym4s-0001wh-Nb for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uym4r-0000N3-1V for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:56:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uym4q-0000MN-Pv for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:56:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6FGuhdN005071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Jul 2013 12:56:43 -0400 From: Markus Armbruster References: <1373552895-17349-1-git-send-email-akong@redhat.com> Date: Mon, 15 Jul 2013 18:56:41 +0200 In-Reply-To: <1373552895-17349-1-git-send-email-akong@redhat.com> (Amos Kong's message of "Thu, 11 Jul 2013 22:28:15 +0800") Message-ID: <87y597wyly.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH MST/PCI] additional fixes for mac-programming feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: qemu-devel@nongnu.org, mst@redhat.com Amos Kong writes: > Markus added some comments on old patchset, this patch contains > some additional fixes, it's based on MST's PCI tree. > > * Fix typos (missed 1.6, NIC) > * Don't initialize list point at its declaration > * Always notify QMP client if mactable is changed > * Returns NULL list if no net client supports rx-filter querying. > > BTW, we can also use e1000 with macvtap device, so we can implement > a query_rx_filter function for e1000 in future. > > Signed-off-by: Amos Kong Addresses those parts of my review that have made it into the PCI tree, thus: Reviewed-by: Markus Armbruster One suggestion inline. > --- > hw/net/virtio-net.c | 24 ++++++++++++++---------- > net/net.c | 19 ++++++++++--------- > qapi-schema.json | 11 ++++++----- > qmp-commands.hx | 10 +++++----- > 4 files changed, 35 insertions(+), 29 deletions(-) > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index c88403a..679f50c 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -226,10 +226,8 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc) > { > VirtIONet *n = qemu_get_nic_opaque(nc); > RxFilterInfo *info; > - strList *str_list = NULL; > - strList *entry; > - intList *int_list = NULL; > - intList *int_entry; > + strList *str_list, *entry; > + intList *int_list, *int_entry; > int i, j; > > info = g_malloc0(sizeof(*info)); > @@ -258,6 +256,7 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc) > > info->main_mac = mac_strdup_printf(n->mac); > > + str_list = NULL; > for (i = 0; i < n->mac_table.first_multi; i++) { > entry = g_malloc0(sizeof(*entry)); > entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN); entry->next = str_list; str_list = entry; } info->unicast_table = str_list; str_list = NULL; for (i = n->mac_table.first_multi; i < n->mac_table.in_use; i++) { entry = g_malloc0(sizeof(*entry)); entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN); entry->next = str_list; str_list = entry; } info->multicast_table = str_list; Suggest a helper function to build str_list. Can be done as a follow-up patch, no need to respin this one. [...]