Signed-off-by: Wen Congyang <address@hidden>
Signed-off-by: Changlong Xie <address@hidden>
---
block/quorum.c | 5 +++++
docs/qmp-events.txt | 18 ++++++++++++++++++
qapi/event.json | 16 ++++++++++++++++
3 files changed, 39 insertions(+)
diff --git a/block/quorum.c b/block/quorum.c
index f78d4cb..d3c3958 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -235,6 +235,11 @@ static void quorum_report_failure(QuorumAIOCB *acb)
acb->nb_sectors, &error_abort);
}
+static void quorum_flush_error(char *node_name, const char *msg)
+{
+ qapi_event_send_quorum_flush_error(node_name, msg, &error_abort);
+}
+
static int quorum_vote_error(QuorumAIOCB *acb);
static bool quorum_has_too_much_io_failed(QuorumAIOCB *acb)
diff --git a/docs/qmp-events.txt b/docs/qmp-events.txt
index b6e8937..d777873 100644
--- a/docs/qmp-events.txt
+++ b/docs/qmp-events.txt
@@ -340,6 +340,24 @@ Example:
Note: this event is rate-limited.
+QUORUM_FLUSH_ERROR
+-----------------
+
+Emitted to report flush error message of the Quorum block driver
+
+Data:
+
+- "node-name": The graph node name of the block driver state.
+- "error": This field contains a human-readable error message. There
are
+ no semantics other than that the block layer reported an
error
+ and clients should not try to interpret the error string.
+
+Example:
+
+{ "event": "QUORUM_FLUSH_ERROR",
+ "data": { "node-name": "1.raw", "error": "xxxxxx" },
+ "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
+
RESET
-----
diff --git a/qapi/event.json b/qapi/event.json
index cfcc887..5b16706 100644
--- a/qapi/event.json
+++ b/qapi/event.json
@@ -358,6 +358,22 @@
'sector-num': 'int', 'sectors-count': 'int' } }
##
+# @QUORUM_FLUSH_ERROR
+#
+# Emitted to report flush error message of the Quorum block driver
+#
+# @node-name: the graph node name of the block driver state
+#
+# @error: This field contains a human-readable error message. There are no
semantics
+# other than that the block layer reported an error and clients should
not
+# try to interpret the error string.
+#
+# Since: 2.5
+##
+{ 'event': 'QUORUM_FLUSH_ERROR',
+ 'data': { 'node-name': 'str', 'error': 'str'} }
+
+##
# @VSERPORT_CHANGE
#
# Emitted when the guest opens or closes a virtio-serial port.