Patchwork [V5,22/28] qapi event: convert NIC_RX_FILTER_CHANGED

login
register
mail settings
Submitter Wenchao Xia
Date May 1, 2014, 4:26 a.m.
Message ID <1398918422-3019-23-git-send-email-wenchaoqemu@gmail.com>
Download mbox | patch
Permalink /patch/344412/
State New
Headers show

Comments

Wenchao Xia - May 1, 2014, 4:26 a.m.
Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
---
 hw/net/virtio-net.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 33bd233..216d4e1 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -22,7 +22,7 @@ 
 #include "net/vhost_net.h"
 #include "hw/virtio/virtio-bus.h"
 #include "qapi/qmp/qjson.h"
-#include "monitor/monitor.h"
+#include "qapi-event.h"
 
 #define VIRTIO_NET_VM_VERSION    11
 
@@ -196,19 +196,12 @@  static void virtio_net_set_link_status(NetClientState *nc)
 
 static void rxfilter_notify(NetClientState *nc)
 {
-    QObject *event_data;
     VirtIONet *n = qemu_get_nic_opaque(nc);
 
     if (nc->rxfilter_notify_enabled) {
         gchar *path = object_get_canonical_path(OBJECT(n->qdev));
-        if (n->netclient_name) {
-            event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
-                                    n->netclient_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);
+        qapi_event_send_nic_rx_filter_changed(!!n->netclient_name,
+                                              n->netclient_name, path, NULL);
         g_free(path);
 
         /* disable event notification to avoid events flooding */