提交 f14993ff 编写于 作者: D Daniel P. Berrange

Replace use of virNetError with virReportError

Update the libvirtd dispatch code to use virReportError
instead of the virNetError custom macro
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 edb768c9
此差异已折叠。
......@@ -32,10 +32,6 @@
#define VIR_FROM_THIS VIR_FROM_STREAMS
#define virNetError(code, ...) \
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
struct daemonClientStream {
daemonClientPrivatePtr priv;
int refs;
......@@ -233,11 +229,11 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
virStreamEventRemoveCallback(stream->st);
virStreamAbort(stream->st);
if (events & VIR_STREAM_EVENT_HANGUP)
virNetError(VIR_ERR_RPC,
"%s", _("stream had unexpected termination"));
virReportError(VIR_ERR_RPC,
"%s", _("stream had unexpected termination"));
else
virNetError(VIR_ERR_RPC,
"%s", _("stream had I/O failure"));
virReportError(VIR_ERR_RPC,
"%s", _("stream had I/O failure"));
msg = virNetMessageNew(false);
if (!msg) {
......@@ -618,13 +614,13 @@ daemonStreamHandleAbort(virNetServerClientPtr client,
virStreamAbort(stream->st);
if (msg->header.status == VIR_NET_ERROR)
virNetError(VIR_ERR_RPC,
"%s", _("stream aborted at client request"));
virReportError(VIR_ERR_RPC,
"%s", _("stream aborted at client request"));
else {
VIR_WARN("unexpected stream status %d", msg->header.status);
virNetError(VIR_ERR_RPC,
_("stream aborted with unexpected status %d"),
msg->header.status);
virReportError(VIR_ERR_RPC,
_("stream aborted with unexpected status %d"),
msg->header.status);
}
return virNetServerProgramSendReplyError(remoteProgram,
......
......@@ -778,15 +778,15 @@ elsif ($opt_b) {
print "\n";
print " if (!priv->conn) {\n";
print " virNetError(VIR_ERR_INTERNAL_ERROR, \"%s\", _(\"connection not open\"));\n";
print " virReportError(VIR_ERR_INTERNAL_ERROR, \"%s\", _(\"connection not open\"));\n";
print " goto cleanup;\n";
print " }\n";
print "\n";
if ($single_ret_as_list) {
print " if (args->$single_ret_list_max_var > $single_ret_list_max_define) {\n";
print " virNetError(VIR_ERR_INTERNAL_ERROR,\n";
print " \"%s\", _(\"max$single_ret_list_name > $single_ret_list_max_define\"));\n";
print " virReportError(VIR_ERR_INTERNAL_ERROR,\n";
print " \"%s\", _(\"max$single_ret_list_name > $single_ret_list_max_define\"));\n";
print " goto cleanup;\n";
print " }\n";
print "\n";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册