From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViP3B-000416-9r for qemu-devel@nongnu.org; Mon, 18 Nov 2013 08:39:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViP35-0004xS-BL for qemu-devel@nongnu.org; Mon, 18 Nov 2013 08:39:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViP35-0004xL-2V for qemu-devel@nongnu.org; Mon, 18 Nov 2013 08:39:31 -0500 Date: Mon, 18 Nov 2013 21:39:26 +0800 From: Amos Kong Message-ID: <20131118133926.GA24582@amosk.info> References: <1384762812-22581-1-git-send-email-akong@redhat.com> <20131118132540.GA31173@stefanha-thinkpad.hitronhub.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131118132540.GA31173@stefanha-thinkpad.hitronhub.home> Subject: Re: [Qemu-devel] [PATCH v2] net: move rxfilter_notify() to net.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: vyasevic@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Mon, Nov 18, 2013 at 02:25:40PM +0100, Stefan Hajnoczi wrote: > On Mon, Nov 18, 2013 at 04:20:12PM +0800, Amos Kong wrote: > > @@ -967,6 +968,27 @@ void print_net_client(Monitor *mon, NetClientState *nc) > > nc->info_str); > > } > > > > +void rxfilter_notify(NetClientState *nc, Object *obj) > > +{ > > + QObject *event_data; > > + gchar *path = object_get_canonical_path(obj); > > + > > + if (nc->rxfilter_notify_enabled) { > > + if (nc->name) { > > + event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }", > > + nc->name, path); > > + } else { > > + event_data = qobject_from_jsonf("{ 'path': %s }", path); > > + } > > + monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data); > > + qobject_decref(event_data); > > + > > + /* disable event notification to avoid events flooding */ > > + nc->rxfilter_notify_enabled = 0; > > Only hw/net/virtio-net.c uses nc->rxfilter_notify_enabled. This > function isn't reusable in its current form so I'm left wondering what > the point of this patch is? > > If you have patches that invoke rxfilter_notify() from other NICs then > please submit them together in a series. I don't have patch to change other NICs to send rxfilter notify right now. So I will send a patch to fix the leak. We can move the function to net.c in future. > Otherwise, let's not move things around just for the sake of it, > especially when the refactoring is not done correctly. > > Stefan -- Amos.