Received: from eggs.gnu.org ([2001:4830:134:3::10]:35265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYCT7-0001Wi-E6 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 07:53:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYCT3-0002FF-Dp for qemu-devel@nongnu.org; Tue, 23 Feb 2016 07:53:33 -0500 Received: from smtp3.mundo-r.com ([212.51.32.191]:27442 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYCT3-0002Es-6i for qemu-devel@nongnu.org; Tue, 23 Feb 2016 07:53:29 -0500 From: Alberto Garcia In-Reply-To: <1456218099-386-2-git-send-email-xiecl.fnst@cn.fujitsu.com> References: <1456218099-386-1-git-send-email-xiecl.fnst@cn.fujitsu.com> <1456218099-386-2-git-send-email-xiecl.fnst@cn.fujitsu.com> Date: Tue, 23 Feb 2016 13:53:25 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v4 1/2] qmp event: Add QUORUM_FLUSH_ERROR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Changlong Xie , qemu devel , Eric Blake , Kevin Wolf , Max Reitz Cc: "Dr. David Alan Gilbert" On Tue 23 Feb 2016 10:01:38 AM CET, Changlong Xie wrote: > @@ -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); > +} > + Instead of 'msg' I think you can receive an error code here and convert it to a message using strerror(). Take a look at quorum_report_bad() to see what I mean. > +QUORUM_FLUSH_ERROR > +----------------- > + > +Emitted to report flush error message of the Quorum block driver Emitted to report a flush error in a Quorum file > + > +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. Can you reformat this paragraph so it takes less than 80 columns? > + > +Example: > + > +{ "event": "QUORUM_FLUSH_ERROR", > + "data": { "node-name": "1.raw", "error": "xxxxxx" }, > + "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } '1.raw' is an invalid node name. > ## > +# @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. Same changes I mentioned earlier. > +# > +# Since: 2.5 Since 2.6 Berto