[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] net: move rxfilter_notify() to net.c
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2] net: move rxfilter_notify() to net.c |
Date: |
Mon, 18 Nov 2013 14:25:40 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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.
Otherwise, let's not move things around just for the sake of it,
especially when the refactoring is not done correctly.
Stefan