* 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
Daniel
This commit is contained in:
Daniel Veillard 2007-11-20 10:15:38 +00:00
parent ef4006b3a5
commit aab34d876e
7 changed files with 32 additions and 4 deletions

View File

@ -1,3 +1,10 @@
Tue Nov 20 11:06:28 CET 2007 Daniel Veillard <veillard@redhat.com>
* 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 <veillard@redhat.com>
* tests/sexpr2xmltest.c tests/xml2sexprtest.c: warn before exiting

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}