[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 30/43] qapi event: convert NIC_RX_FILTER_CHANGED
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 30/43] qapi event: convert NIC_RX_FILTER_CHANGED |
Date: |
Mon, 23 Jun 2014 12:36:30 -0400 |
From: Wenchao Xia <address@hidden>
Param name is declared as optional, since in code it is an optional
one.
Signed-off-by: Wenchao Xia <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
docs/qmp/qmp-events.txt | 17 -----------------
hw/net/virtio-net.c | 13 +++----------
qapi-event.json | 15 +++++++++++++++
3 files changed, 18 insertions(+), 27 deletions(-)
diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
index 4bde051..a8be132 100644
--- a/docs/qmp/qmp-events.txt
+++ b/docs/qmp/qmp-events.txt
@@ -42,23 +42,6 @@ Example:
{ "event": "GUEST_PANICKED",
"data": { "action": "pause" } }
-NIC_RX_FILTER_CHANGED
----------------------
-
-The event is emitted once until the query command is executed,
-the first event will always be emitted.
-
-Data:
-
-- "name": net client name (json-string)
-- "path": device path (json-string)
-
-{ "event": "NIC_RX_FILTER_CHANGED",
- "data": { "name": "vnet0",
- "path": "/machine/peripheral/vnet0/virtio-backend" },
- "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
-}
-
QUORUM_FAILURE
--------------
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index d8588f3..00b5e07 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
@@ -199,19 +199,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,
&error_abort);
g_free(path);
/* disable event notification to avoid events flooding */
diff --git a/qapi-event.json b/qapi-event.json
index c880d77..b8dec47 100644
--- a/qapi-event.json
+++ b/qapi-event.json
@@ -122,3 +122,18 @@
##
{ 'event': 'DEVICE_DELETED',
'data': { '*device': 'str', 'path': 'str' } }
+
+##
+# @NIC_RX_FILTER_CHANGED
+#
+# Emitted once until the 'query-rx-filter' command is executed, the first event
+# will always be emitted
+#
+# @name: #optional, net client name
+#
+# @path: device path
+#
+# Since: 1.6
+##
+{ 'event': 'NIC_RX_FILTER_CHANGED',
+ 'data': { '*name': 'str', 'path': 'str' } }
--
1.9.3
- [Qemu-devel] [PULL 11/43] test: add test cases for qapi event, (continued)
- [Qemu-devel] [PULL 11/43] test: add test cases for qapi event, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 17/43] qapi event: convert RESET, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 18/43] qapi event: convert STOP, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 22/43] qapi event: convert WAKEUP, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 23/43] qapi event: convert RTC_CHANGE, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 15/43] qapi event: convert SHUTDOWN, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 27/43] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 26/43] qapi event: convert DEVICE_TRAY_MOVED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 32/43] qapi event: convert SPICE events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 28/43] qapi event: convert BLOCK_IMAGE_CORRUPTED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 30/43] qapi event: convert NIC_RX_FILTER_CHANGED,
Luiz Capitulino <=
- [Qemu-devel] [PULL 31/43] qapi event: convert VNC events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 33/43] qmp: convert ACPI_DEVICE_OST event, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 35/43] qapi event: convert GUEST_PANICKED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 36/43] qapi event: convert QUORUM events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 38/43] qemu-char: introduce qemu_chr_alloc, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 40/43] qemu-char: move pty_chr_update_read_handler around, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 05/43] qapi: Suppress unwanted space between type and identifier, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 41/43] qemu-char: make writes thread-safe, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 04/43] qapi: add const prefix to 'char *' insider c_type(), Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 10/43] qapi script: add event support, Luiz Capitulino, 2014/06/23