diff --git a/ChangeLog b/ChangeLog index e95007eec2..8a9e40b88c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Nov 20 11:06:28 CET 2007 Daniel Veillard + + * include/libvirt/virterror.h src/openvz_conf.c src/openvz_driver.c + src/stats_linux.c src/virterror.c src/xm_internal.c: patch from + Saori Fukuta cleaning up various problems in the error reporting + layers + Tue Nov 20 11:03:02 CET 2007 Daniel Veillard * tests/sexpr2xmltest.c tests/xml2sexprtest.c: warn before exiting diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 8e2701f47e..505c6d117b 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -52,6 +52,8 @@ typedef enum { VIR_FROM_TEST, /* Error from test driver */ VIR_FROM_REMOTE, /* Error from remote driver */ VIR_FROM_OPENVZ, /* Error from OpenVZ driver */ + VIR_FROM_XENXM, /* Error at Xen XM layer */ + VIR_FROM_LINUX, /* Error in the Linux Stats code */ } virErrorDomain; diff --git a/src/openvz_conf.c b/src/openvz_conf.c index ed577608a3..c9f8536c56 100644 --- a/src/openvz_conf.c +++ b/src/openvz_conf.c @@ -67,7 +67,7 @@ error (virConnectPtr conn, virErrorNumber code, const char *info) const char *errmsg; errmsg = __virErrorMsg (code, info); - __virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE, + __virRaiseError (conn, NULL, NULL, VIR_FROM_OPENVZ, code, VIR_ERR_ERROR, errmsg, info, NULL, 0, 0, errmsg, info); } diff --git a/src/openvz_driver.c b/src/openvz_driver.c index 033b19614e..aa554f2f4d 100644 --- a/src/openvz_driver.c +++ b/src/openvz_driver.c @@ -138,7 +138,7 @@ error (virConnectPtr conn, virErrorNumber code, const char *info) const char *errmsg; errmsg = __virErrorMsg (code, info); - __virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE, + __virRaiseError (conn, NULL, NULL, VIR_FROM_OPENVZ, code, VIR_ERR_ERROR, errmsg, info, NULL, 0, 0, errmsg, info); } diff --git a/src/stats_linux.c b/src/stats_linux.c index 9c7ed72e2e..8c35eb5291 100644 --- a/src/stats_linux.c +++ b/src/stats_linux.c @@ -51,7 +51,7 @@ statsErrorFunc (virConnectPtr conn, fullinfo[sizeof (fullinfo) - 1] = 0; info = fullinfo; } - __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, + __virRaiseError(conn, NULL, NULL, VIR_FROM_LINUX, error, VIR_ERR_ERROR, errmsg, info, NULL, value, 0, errmsg, info, value); } diff --git a/src/virterror.c b/src/virterror.c index 01be142f2d..a315cdedf7 100644 --- a/src/virterror.c +++ b/src/virterror.c @@ -280,6 +280,25 @@ virDefaultErrorFunc(virErrorPtr err) case VIR_FROM_REMOTE: dom = "Remote "; break; + case VIR_FROM_SEXPR: + dom = "S-Expr "; + break; + case VIR_FROM_PROXY: + dom = "PROXY "; + break; + case VIR_FROM_CONF: + dom = "Config "; + break; + case VIR_FROM_OPENVZ: + dom = "OpenVZ "; + break; + case VIR_FROM_XENXM: + dom = "Xen XM "; + break; + case VIR_FROM_LINUX: + dom = "Linux Stats "; + break; + } if ((err->dom != NULL) && (err->code != VIR_ERR_INVALID_DOMAIN)) { domain = err->dom->name; diff --git a/src/xm_internal.c b/src/xm_internal.c index 426d7a7494..c01106756e 100644 --- a/src/xm_internal.c +++ b/src/xm_internal.c @@ -127,7 +127,7 @@ xenXMError(virConnectPtr conn, virErrorNumber error, const char *info) return; errmsg = __virErrorMsg(error, info); - __virRaiseError(conn, NULL, NULL, VIR_FROM_XEND, error, VIR_ERR_ERROR, + __virRaiseError(conn, NULL, NULL, VIR_FROM_XENXM, error, VIR_ERR_ERROR, errmsg, info, NULL, 0, 0, errmsg, info); }