+Tue Nov 4 22:20:31 UTC 2008 Daniel P. Berrange <berrange@redhat.com>
+
+ Move internal error API declarations into their own file
+ * src/Makefile.am, src/virterror_internal.h: Add file for
+ internal error reporting APIs.
+ * src/internal.c: Remove virRaiseError/virReportError API
+ declarations
+ * src/conf.c, src/domain_conf.c, src/hash.c,
+ src/libvirt.c, src/lxc_conf.c, src/lxc_conf.h,
+ src/lxc_container.c, src/lxc_controller.c, src/lxc_driver.c,
+ src/network_conf.c, src/network_driver.c, src/nodeinfo.c,
+ src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c,
+ src/proxy_internal.c, src/qemu_conf.c, src/qemu_conf.h,
+ src/qemu_driver.c, src/qparams.c, src/remote_internal.c,
+ src/sexpr.c, src/stats_linux.c, src/storage_backend.c,
+ src/storage_backend_disk.c, src/storage_backend_fs.c,
+ src/storage_backend_iscsi.c, src/storage_backend_logical.c,
+ src/storage_conf.c, src/storage_conf.h, src/storage_driver.c,
+ src/test.c, src/util.c, src/virterror.c, src/xen_internal.c,
+ src/xen_unified.c, src/xend_internal.c, src/xm_internal.c,
+ src/xml.c, src/xmlrpc.c, src/xs_internal.c: Add includes
+ of new virterror_internal.h file where required, and remove
+ leading __ from virRaiseError api calls
+
Tue Nov 4 22:14:31 UTC 2008 Daniel P. Berrange <berrange@redhat.com>
Support passing UUID and ID to qemu/xenner
stats_linux.c stats_linux.h \
uuid.c uuid.h \
util.c util.h \
- virterror.c \
+ virterror.c virterror_internal.h \
xml.c xml.h
# Domain driver generic impl APIs
driver.h \
hash.c hash.h \
internal.h \
- libvirt.c \
+ libvirt.c libvirt_internal.h \
$(GENERIC_LIB_SOURCES) \
$(DOMAIN_CONF_SOURCES) \
$(NETWORK_CONF_SOURCES) \
#include <sys/stat.h>
#include <fcntl.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "buf.h"
#include "conf.h"
#include "util.h"
/* Construct the string 'filename:line: info' if we have that. */
if (ctxt && ctxt->filename) {
- __virRaiseError(NULL, NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR,
+ virRaiseError(NULL, NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR,
info, ctxt->filename, NULL,
ctxt->line, 0,
"%s:%d: %s", ctxt->filename, ctxt->line, info);
} else {
- format = __virErrorMsg(error, info);
- __virRaiseError(NULL, NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR,
+ format = virErrorMsg(error, info);
+ virRaiseError(NULL, NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR,
info, NULL, NULL,
ctxt ? ctxt->line : 0, 0,
format, info);
#include <fcntl.h>
#include <dirent.h>
-#include "internal.h"
-
+#include "virterror_internal.h"
#include "domain_conf.h"
#include "memory.h"
#include "verify.h"
"pci")
#define virDomainReportError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_DOMAIN, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_DOMAIN, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
virDomainObjPtr virDomainFindByID(const virDomainObjListPtr doms,
#include <string.h>
#include <stdlib.h>
#include <libxml/threads.h>
-#include "internal.h"
+
+#include "virterror_internal.h"
#include "hash.h"
#include "memory.h"
/* #define DEBUG_GROW */
#define virHashError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
/*
virHashFree(conn->storageVols, (virHashDeallocator) virStorageVolFreeName);
virResetError(&conn->err);
- if (__lastErr.conn == conn)
- __lastErr.conn = NULL;
+ if (virLastErr.conn == conn)
+ virLastErr.conn = NULL;
VIR_FREE(conn->name);
if (conn->err.dom == domain)
conn->err.dom = NULL;
- if (__lastErr.dom == domain)
- __lastErr.dom = NULL;
+ if (virLastErr.dom == domain)
+ virLastErr.dom = NULL;
domain->magic = -1;
domain->id = -1;
VIR_FREE(domain->name);
if (conn->err.net == network)
conn->err.net = NULL;
- if (__lastErr.net == network)
- __lastErr.net = NULL;
+ if (virLastErr.net == network)
+ virLastErr.net = NULL;
network->magic = -1;
VIR_FREE(network->name);
};
-/************************************************************************
- * *
- * API for error handling *
- * *
- ************************************************************************/
-extern virError __lastErr;
-void __virRaiseError(virConnectPtr conn,
- virDomainPtr dom,
- virNetworkPtr net,
- int domain,
- int code,
- virErrorLevel level,
- const char *str1,
- const char *str2,
- const char *str3,
- int int1, int int2, const char *msg, ...)
- ATTRIBUTE_FORMAT(printf, 12, 13);
-const char *__virErrorMsg(virErrorNumber error, const char *info);
-void __virReportErrorHelper(virConnectPtr conn, int domcode, int errcode,
- const char *filename ATTRIBUTE_UNUSED,
- const char *funcname ATTRIBUTE_UNUSED,
- long long linenr ATTRIBUTE_UNUSED,
- const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 7, 8);
/************************************************************************
* *
#include <winsock2.h>
#endif
-#include "internal.h"
+#include "virterror_internal.h"
#include "driver.h"
#include "uuid.h"
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
- __virRaiseError(conn, NULL, NULL, VIR_FROM_NONE, error, VIR_ERR_ERROR,
- errmsg, info, NULL, 0, 0, errmsg, info);
+ errmsg = virErrorMsg(error, info);
+ virRaiseError(conn, NULL, NULL, VIR_FROM_NONE, error, VIR_ERR_ERROR,
+ errmsg, info, NULL, 0, 0, errmsg, info);
}
/**
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
- __virRaiseError(conn, NULL, NULL, VIR_FROM_NONE, error, VIR_ERR_WARNING,
- errmsg, info, NULL, 0, 0, errmsg, info);
+ errmsg = virErrorMsg(error, info);
+ virRaiseError(conn, NULL, NULL, VIR_FROM_NONE, error, VIR_ERR_WARNING,
+ errmsg, info, NULL, 0, 0, errmsg, info);
}
/**
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
+ errmsg = virErrorMsg(error, info);
if (error != VIR_ERR_INVALID_DOMAIN) {
conn = domain->conn;
}
- __virRaiseError(conn, domain, NULL, VIR_FROM_DOM, error, VIR_ERR_ERROR,
- errmsg, info, NULL, 0, 0, errmsg, info);
+ virRaiseError(conn, domain, NULL, VIR_FROM_DOM, error, VIR_ERR_ERROR,
+ errmsg, info, NULL, 0, 0, errmsg, info);
}
/**
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
+ errmsg = virErrorMsg(error, info);
if (error != VIR_ERR_INVALID_NETWORK) {
conn = network->conn;
}
- __virRaiseError(conn, NULL, network, VIR_FROM_NET, error, VIR_ERR_ERROR,
- errmsg, info, NULL, 0, 0, errmsg, info);
+ virRaiseError(conn, NULL, network, VIR_FROM_NET, error, VIR_ERR_ERROR,
+ errmsg, info, NULL, 0, 0, errmsg, info);
}
/**
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
+ errmsg = virErrorMsg(error, info);
if (error != VIR_ERR_INVALID_STORAGE_POOL)
conn = pool->conn;
- __virRaiseError(conn, NULL, NULL, VIR_FROM_STORAGE, error, VIR_ERR_ERROR,
- errmsg, info, NULL, 0, 0, errmsg, info);
+ virRaiseError(conn, NULL, NULL, VIR_FROM_STORAGE, error, VIR_ERR_ERROR,
+ errmsg, info, NULL, 0, 0, errmsg, info);
}
/**
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
+ errmsg = virErrorMsg(error, info);
if (error != VIR_ERR_INVALID_STORAGE_VOL)
conn = vol->conn;
- __virRaiseError(conn, NULL, NULL, VIR_FROM_STORAGE, error, VIR_ERR_ERROR,
- errmsg, info, NULL, 0, 0, errmsg, info);
+ virRaiseError(conn, NULL, NULL, VIR_FROM_STORAGE, error, VIR_ERR_ERROR,
+ errmsg, info, NULL, 0, 0, errmsg, info);
}
/**
/* If no global error was set, copy any error set
in the connection object we're about to dispose of */
- if (__lastErr.code == VIR_ERR_OK) {
- memcpy(&__lastErr, &ret->err, sizeof(ret->err));
+ if (virLastErr.code == VIR_ERR_OK) {
+ memcpy(&virLastErr, &ret->err, sizeof(ret->err));
memset(&ret->err, 0, sizeof(ret->err));
}
/* Still no error set, then raise a generic error */
- if (__lastErr.code == VIR_ERR_OK)
+ if (virLastErr.code == VIR_ERR_OK)
virLibConnError (NULL, VIR_ERR_INTERNAL_ERROR,
_("unable to open connection"));
#include <sys/utsname.h>
+#include "virterror_internal.h"
#include "lxc_conf.h"
/* Functions */
virCapsPtr lxcCapsInit(void);
#define lxcError(conn, dom, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_LXC, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_LXC, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#endif /* LXC_CONF_H */
/* For MS_MOVE */
#include <linux/fs.h>
+#include "virterror_internal.h"
#include "lxc_container.h"
#include "util.h"
#include "memory.h"
#include <signal.h>
#include <getopt.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "util.h"
#include "lxc_conf.h"
#include <unistd.h>
#include <wait.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "lxc_conf.h"
#include "lxc_container.h"
#include "lxc_driver.h"
#include <string.h>
#include <dirent.h>
-#include "internal.h"
-
+#include "virterror_internal.h"
#include "network_conf.h"
#include "memory.h"
#include "xml.h"
"none", "nat", "route" )
#define virNetworkReportError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_NETWORK, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_NETWORK, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
virNetworkObjPtr virNetworkFindByUUID(const virNetworkObjListPtr nets,
#include <sys/wait.h>
#include <sys/ioctl.h>
+#include "virterror_internal.h"
#include "network_driver.h"
#include "network_conf.h"
#include "driver.h"
#define networkLog(level, msg...) fprintf(stderr, msg)
#define networkReportError(conn, dom, net, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_QEMU, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_QEMU, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#include <sys/utsname.h>
#endif
-#include "internal.h"
+#include "virterror_internal.h"
#include "nodeinfo.h"
#include "physmem.h"
#include "util.h"
while (*buf && c_isspace(*buf))
buf++;
if (*buf != ':') {
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"parsing cpuinfo processor");
return -1;
while (*buf && c_isspace(*buf))
buf++;
if (*buf != ':' || !buf[1]) {
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"parsing cpuinfo cpu MHz");
return -1;
while (*buf && c_isspace(*buf))
buf++;
if (*buf != ':' || !buf[1]) {
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"parsing cpuinfo cpu cores %c", *buf);
return -1;
}
if (!nodeinfo->cpus) {
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"no cpus found");
return -1;
struct utsname info;
if (uname(&info) < 0) {
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"cannot extract machine type %s", strerror(errno));
return -1;
int ret;
FILE *cpuinfo = fopen(CPUINFO_PATH, "r");
if (!cpuinfo) {
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"cannot open %s %s", CPUINFO_PATH, strerror(errno));
return -1;
}
#else
/* XXX Solaris will need an impl later if they port QEMU driver */
- __virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
+ virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"%s:%s not implemented on this platform\n", __FILE__, __FUNCTION__);
return -1;
#include <sys/utsname.h>
#include <sys/wait.h>
+#include "virterror_internal.h"
#include "openvz_conf.h"
#include "uuid.h"
#include "buf.h"
fprintf(stderr, "\n"); }
#define openvzError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#include <stdio.h>
#include <sys/wait.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "openvz_driver.h"
#include "event.h"
#include "buf.h"
#include <sys/un.h>
#include <sys/wait.h>
#include <string.h>
-#include "internal.h"
+
+#include "virterror_internal.h"
#include "driver.h"
#include "proxy_internal.h"
#include "util.h"
************************************************************************/
#define virProxyError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_PROXY, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_PROXY, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
/************************************************************************
#include <numa.h>
#endif
+#include "virterror_internal.h"
#include "qemu_conf.h"
#include "uuid.h"
#include "buf.h"
#define qemudReportError(conn, dom, net, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_QEMU, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_QEMU, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#include <sched.h>
#endif
+#include "virterror_internal.h"
#include "qemu_driver.h"
#include "qemu_conf.h"
#include "c-ctype.h"
#include <stdlib.h>
#include <stdarg.h>
+#include "virterror_internal.h"
#include "buf.h"
#include "memory.h"
#include "qparams.h"
#define qparam_report_oom(void) \
- __virReportErrorHelper(NULL, VIR_FROM_NONE, VIR_ERR_NO_MEMORY, \
+ virReportErrorHelper(NULL, VIR_FROM_NONE, VIR_ERR_NO_MEMORY, \
__FILE__, __FUNCTION__, __LINE__, NULL)
struct qparam_set *
# define AI_ADDRCONFIG 0
#endif
-#include "internal.h"
+#include "virterror_internal.h"
#include "driver.h"
#include "buf.h"
#include "qparams.h"
} else if (STRCASEEQ(authtype, "polkit")) {
want = REMOTE_AUTH_POLKIT;
} else {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
NULL, NULL, NULL, 0, 0,
_("unknown authentication type %s"), authtype);
type = want;
}
if (type == REMOTE_AUTH_NONE) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("requested authentication type %s rejected"),
authtype);
break;
default:
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
NULL, NULL, NULL, 0, 0,
_("unsupported authentication type %d"),
host, sizeof(host),
port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
- __virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_NO_MEMORY, VIR_ERR_ERROR,
NULL, NULL, NULL, 0, 0,
_("Cannot resolve address %d: %s"),
}
if (VIR_ALLOC_N(addr, strlen(host) + 1 + strlen(port) + 1) < 0) {
- __virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_NO_MEMORY, VIR_ERR_ERROR,
NULL, NULL, NULL, 0, 0,
"address");
/* Sets up the SASL library as a whole */
err = sasl_client_init(NULL);
if (err != SASL_OK) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("failed to initialize SASL library: %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
/* Get local address in form IPADDR:PORT */
salen = sizeof(sa);
if (getsockname(priv->sock, (struct sockaddr*)&sa, &salen) < 0) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("failed to get sock address %d (%s)"),
errno, strerror(errno));
/* Get remote address in form IPADDR:PORT */
salen = sizeof(sa);
if (getpeername(priv->sock, (struct sockaddr*)&sa, &salen) < 0) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("failed to get peer address %d (%s)"),
errno, strerror(errno));
&saslconn);
if (err != SASL_OK) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("Failed to create SASL client context: %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
cipher = gnutls_cipher_get(priv->session);
if (!(ssf = (sasl_ssf_t)gnutls_cipher_get_key_size(cipher))) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_INTERNAL_ERROR, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"%s", _("invalid cipher size for TLS session"));
goto cleanup;
DEBUG("Setting external SSF %d", ssf);
err = sasl_setprop(saslconn, SASL_SSF_EXTERNAL, &ssf);
if (err != SASL_OK) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_INTERNAL_ERROR, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("cannot set external SSF %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
err = sasl_setprop(saslconn, SASL_SEC_PROPS, &secprops);
if (err != SASL_OK) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_INTERNAL_ERROR, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("cannot set security props %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
mechlist = iret.mechlist;
if (wantmech) {
if (strstr(mechlist, wantmech) == NULL) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
NULL, NULL, NULL, 0, 0,
_("SASL mechanism %s not supported by server"),
&clientoutlen,
&mech);
if (err != SASL_OK && err != SASL_CONTINUE && err != SASL_INTERACT) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("Failed to start SASL negotiation: %d (%s)"),
err, sasl_errdetail(saslconn));
}
if ((ncred =
remoteAuthMakeCredentials(interact, &cred)) < 0) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
NULL, NULL, NULL, 0, 0,
"%s", _("Failed to make auth credentials"));
} else {
msg = "No authentication callback available";
}
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL,
0, 0, "%s", msg);
goto cleanup;
VIR_FREE(iret.mechlist);
if (clientoutlen > REMOTE_AUTH_SASL_DATA_MAX) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("SASL negotiation data too long: %d bytes"),
clientoutlen);
&clientout,
&clientoutlen);
if (err != SASL_OK && err != SASL_CONTINUE && err != SASL_INTERACT) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("Failed SASL step: %d (%s)"),
err, sasl_errdetail(saslconn));
cred = NULL;
}
if ((ncred = remoteAuthMakeCredentials(interact, &cred)) < 0) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"%s", _("Failed to make auth credentials"));
goto cleanup;
} else {
msg = "No authentication callback available";
}
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL,
0, 0, "%s", msg);
goto cleanup;
if (!priv->uses_tls) {
err = sasl_getprop(saslconn, SASL_SSF, &val);
if (err != SASL_OK) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("cannot query SASL ssf on connection %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
ssf = *(const int *)val;
DEBUG("SASL SSF value %d", ssf);
if (ssf < 56) { /* 56 == DES level, good for Kerberos */
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("negotiation SSF %d was not strong enough"), ssf);
goto cleanup;
if (allowcb) {
/* Run the authentication callback */
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
- __virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
"%s", _("Failed to collect auth credentials"));
return -1;
/* Check program, version, etc. are what we expect. */
if (hdr.prog != REMOTE_PROGRAM) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("unknown program (received %x, expected %x)"),
return -1;
}
if (hdr.vers != REMOTE_PROTOCOL_VERSION) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("unknown protocol version (received %x, expected %x)"),
goto retry_read;
}
if (hdr.proc != proc_nr) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("unknown procedure (received %x, expected %x)"),
return -1;
}
if (hdr.direction != REMOTE_REPLY) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("unknown direction (received %x, expected %x)"),
return -1;
}
if (hdr.serial != serial) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("unknown serial (received %x, expected %x)"),
hdr.serial, serial);
return -1;
default:
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
_("unknown status (received %x)"),
hdr.status);
{
const char *errmsg;
- errmsg = __virErrorMsg (code, info);
- __virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE,
+ errmsg = virErrorMsg (code, info);
+ virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE,
code, VIR_ERR_ERROR, errmsg, info, NULL, 0, 0,
errmsg, info);
}
errorMessage[0] = '\0';
}
- errmsg = __virErrorMsg (code, errorMessage);
- __virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE,
+ errmsg = virErrorMsg (code, errorMessage);
+ virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE,
code, VIR_ERR_ERROR,
errmsg, errorMessage, NULL, -1, -1,
errmsg, errorMessage);
dom = err->dom ? get_nonnull_domain (conn, *err->dom) : NULL;
net = err->net ? get_nonnull_network (conn, *err->net) : NULL;
- __virRaiseError (conn, dom, net,
+ virRaiseError (conn, dom, net,
err->domain, err->code, err->level,
err->str1 ? *err->str1 : NULL,
err->str2 ? *err->str2 : NULL,
/* get_nonnull_domain and get_nonnull_network turn an on-wire
* (name, uuid) pair into virDomainPtr or virNetworkPtr object.
* These can return NULL if underlying memory allocations fail,
- * but if they do then virterror has been set.
+ * but if they do then virterror_internal.has been set.
*/
static virDomainPtr
get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain)
#include "c-ctype.h"
#include <errno.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "sexpr.h"
#include "util.h"
#include "memory.h"
#define virSexprError(code, fmt...) \
- __virReportErrorHelper(NULL, VIR_FROM_SEXPR, code, __FILE__, \
+ virReportErrorHelper(NULL, VIR_FROM_SEXPR, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
/**
#include <xs.h>
#endif
-#include "internal.h"
+#include "virterror_internal.h"
#include "util.h"
#include "xen_unified.h"
#include "stats_linux.h"
char fullinfo[1000];
const char *errmsg;
- errmsg = __virErrorMsg(error, info);
+ errmsg = virErrorMsg(error, info);
if (func != NULL) {
snprintf(fullinfo, sizeof (fullinfo) - 1, "%s: %s", func, info);
fullinfo[sizeof (fullinfo) - 1] = 0;
info = fullinfo;
}
- __virRaiseError(conn, NULL, NULL, VIR_FROM_STATS_LINUX, error,
+ virRaiseError(conn, NULL, NULL, VIR_FROM_STATS_LINUX, error,
VIR_ERR_ERROR,
errmsg, info, NULL, value, 0, errmsg, info,
value);
#include <selinux/selinux.h>
#endif
-#include "internal.h"
+#include "virterror_internal.h"
#include "util.h"
#include "memory.h"
#include <string.h>
#include <unistd.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "storage_backend_disk.h"
#include "util.h"
#include "memory.h"
#include <libxml/tree.h>
#include <libxml/xpath.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "storage_backend_fs.h"
#include "storage_conf.h"
#include "util.h"
#include <unistd.h>
#include <dirent.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "storage_backend_iscsi.h"
#include "util.h"
#include "memory.h"
#include <unistd.h>
#include <fcntl.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "storage_backend_logical.h"
#include "storage_conf.h"
#include "util.h"
#include <fcntl.h>
#include <string.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "storage_conf.h"
#include "storage_backend.h"
#include "xml.h"
}
#define virStorageReportError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_STORAGE, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_STORAGE, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
int virStoragePoolLoadAllConfigs(virConnectPtr conn,
#include <errno.h>
#include <string.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "driver.h"
#include "util.h"
#include "storage_driver.h"
#include <sys/stat.h>
#include <libxml/xmlsave.h>
+
+#include "virterror_internal.h"
#include "test.h"
#include "buf.h"
#include "util.h"
} \
#define testError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_TEST, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_TEST, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
static virCapsPtr
#include <paths.h>
#endif
-#include "internal.h"
+#include "virterror_internal.h"
#include "event.h"
#include "buf.h"
#include "util.h"
#ifndef PROXY
#define ReportError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
int virFileStripSuffix(char *str,
#include <string.h>
#include <stdarg.h>
-#include "internal.h"
-#include "libvirt/virterror.h"
+#include "virterror_internal.h"
-virError __lastErr = /* the last error */
+virError virLastErr = /* the last error */
{ .code = 0, .domain = 0, .message = NULL, .level = VIR_ERR_NONE,
.conn = NULL, .dom = NULL, .str1 = NULL, .str2 = NULL, .str3 = NULL,
.int1 = 0, .int2 = 0, .net = NULL };
-static virErrorFunc virErrorHandler = NULL; /* global error handler */
-static void *virUserData = NULL; /* associated data */
+virErrorFunc virErrorHandler = NULL; /* global error handler */
+void *virUserData = NULL; /* associated data */
/*
- * Macro used to format the message as a string in __virRaiseError
+ * Macro used to format the message as a string in virRaiseError
* and borrowed from libxml2.
*/
#define VIR_GET_VAR_STR(msg, str) { \
virErrorPtr
virGetLastError(void)
{
- if (__lastErr.code == VIR_ERR_OK)
+ if (virLastErr.code == VIR_ERR_OK)
return (NULL);
- return (&__lastErr);
+ return (&virLastErr);
}
/*
{
if (to == NULL)
return (-1);
- if (__lastErr.code == VIR_ERR_OK)
+ if (virLastErr.code == VIR_ERR_OK)
return (0);
- memcpy(to, &__lastErr, sizeof(virError));
- return (__lastErr.code);
+ memcpy(to, &virLastErr, sizeof(virError));
+ return (virLastErr.code);
}
/**
void
virResetLastError(void)
{
- virResetError(&__lastErr);
+ virResetError(&virLastErr);
}
/**
}
/**
- * __virRaiseError:
+ * virRaiseError:
* @conn: the connection to the hypervisor if available
* @dom: the domain if available
* @net: the network if available
* immediately if a callback is found and store it for later handling.
*/
void
-__virRaiseError(virConnectPtr conn, virDomainPtr dom, virNetworkPtr net,
- int domain, int code, virErrorLevel level,
- const char *str1, const char *str2, const char *str3,
- int int1, int int2, const char *msg, ...)
+virRaiseError(virConnectPtr conn, virDomainPtr dom, virNetworkPtr net,
+ int domain, int code, virErrorLevel level,
+ const char *str1, const char *str2, const char *str3,
+ int int1, int int2, const char *msg, ...)
{
- virErrorPtr to = &__lastErr;
+ virErrorPtr to = &virLastErr;
void *userData = virUserData;
virErrorFunc handler = virErrorHandler;
char *str;
}
/**
- * __virErrorMsg:
+ * virErrorMsg:
* @error: the virErrorNumber
* @info: usually the first parameter string
*
* Returns the constant string associated to @error
*/
const char *
-__virErrorMsg(virErrorNumber error, const char *info)
+virErrorMsg(virErrorNumber error, const char *info)
{
const char *errmsg = NULL;
}
/**
- * __virReportErrorHelper
+ * virReportErrorHelper
*
* @conn: the connection to the hypervisor if available
* @dom: the domain if available
* Helper function to do most of the grunt work for individual driver
* ReportError
*/
-void __virReportErrorHelper(virConnectPtr conn, int domcode, int errcode,
- const char *filename ATTRIBUTE_UNUSED,
- const char *funcname ATTRIBUTE_UNUSED,
- long long linenr ATTRIBUTE_UNUSED,
- const char *fmt, ...)
+void virReportErrorHelper(virConnectPtr conn, int domcode, int errcode,
+ const char *filename ATTRIBUTE_UNUSED,
+ const char *funcname ATTRIBUTE_UNUSED,
+ long long linenr ATTRIBUTE_UNUSED,
+ const char *fmt, ...)
{
va_list args;
char errorMessage[1024];
errorMessage[0] = '\0';
}
- virerr = __virErrorMsg(errcode, (errorMessage[0] ? errorMessage : NULL));
- __virRaiseError(conn, NULL, NULL, domcode, errcode, VIR_ERR_ERROR,
- virerr, errorMessage, NULL, -1, -1, virerr, errorMessage);
+ virerr = virErrorMsg(errcode, (errorMessage[0] ? errorMessage : NULL));
+ virRaiseError(conn, NULL, NULL, domcode, errcode, VIR_ERR_ERROR,
+ virerr, errorMessage, NULL, -1, -1, virerr, errorMessage);
}
--- /dev/null
+/*
+ * virterror.h: internal error handling
+ *
+ * Copyright (C) 2006-2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __VIRT_ERROR_H_
+#define __VIRT_ERROR_H_
+
+#include "internal.h"
+
+extern virError virLastErr;
+extern virErrorFunc virErrorHandler;
+extern void *virUserData;
+
+/************************************************************************
+ * *
+ * API for error handling *
+ * *
+ ************************************************************************/
+void virRaiseError(virConnectPtr conn,
+ virDomainPtr dom,
+ virNetworkPtr net,
+ int domain,
+ int code,
+ virErrorLevel level,
+ const char *str1,
+ const char *str2,
+ const char *str3,
+ int int1, int int2, const char *msg, ...)
+ ATTRIBUTE_FORMAT(printf, 12, 13);
+const char *virErrorMsg(virErrorNumber error, const char *info);
+void virReportErrorHelper(virConnectPtr conn, int domcode, int errcode,
+ const char *filename ATTRIBUTE_UNUSED,
+ const char *funcname ATTRIBUTE_UNUSED,
+ long long linenr ATTRIBUTE_UNUSED,
+ const char *fmt, ...)
+ ATTRIBUTE_FORMAT(printf, 7, 8);
+
+
+#endif
#include <errno.h>
#include <sys/utsname.h>
-#include "xs_internal.h"
-#include "stats_linux.h"
-#include "xend_internal.h"
-#include "util.h"
-
/* required for dom0_getdomaininfo_t */
#include <xen/dom0_ops.h>
#include <xen/version.h>
/* required for shutdown flags */
#include <xen/sched.h>
+#include "virterror_internal.h"
+#include "driver.h"
+#include "util.h"
+#include "xen_unified.h"
+#include "xen_internal.h"
+#include "xs_internal.h"
+#include "stats_linux.h"
+#include "xend_internal.h"
#include "buf.h"
#include "capabilities.h"
#include "memory.h"
};
typedef struct xen_op_v2_dom xen_op_v2_dom;
-#include "internal.h"
-#include "driver.h"
-#include "xen_unified.h"
-#include "xen_internal.h"
#ifdef __linux__
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
#define virXenError(conn, code, fmt...) \
if (in_init == 0) \
- __virReportErrorHelper(conn, VIR_FROM_XEN, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_XEN, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#ifndef PROXY
return;
- errmsg = __virErrorMsg(error, info);
+ errmsg =virErrorMsg(error, info);
if (func != NULL) {
snprintf(fullinfo, 999, "%s: %s", func, info);
fullinfo[999] = 0;
- __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR,
+ virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR,
errmsg, fullinfo, NULL, value, 0, errmsg, fullinfo,
value);
} else {
- __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR,
+ virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR,
errmsg, info, NULL, value, 0, errmsg, info,
value);
}
#include <xen/dom0_ops.h>
#include <libxml/uri.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "xen_unified.h"
};
#define xenUnifiedError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_XEN, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_XEN, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
/*
#include <libxml/uri.h>
#include <errno.h>
+#include "virterror_internal.h"
#include "xend_internal.h"
#include "driver.h"
#include "util.h"
#endif
#define virXendError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_XEND, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_XEND, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#define virXendErrorInt(conn, code, ival) \
#include <stdint.h>
#include <xen/dom0_ops.h>
+#include "virterror_internal.h"
#include "xm_internal.h"
#include "xen_unified.h"
#include "xend_internal.h"
};
#define xenXMError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_XENXM, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_XENXM, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
int
#include <stdarg.h>
#include <limits.h>
#include <math.h> /* for isnan() */
-#include "internal.h"
+
+#include "virterror_internal.h"
#include "xml.h"
#include "buf.h"
#include "util.h"
#include "memory.h"
#define virXMLError(conn, code, fmt...) \
- __virReportErrorHelper(conn, VIR_FROM_XML, code, __FILE__, \
+ virReportErrorHelper(conn, VIR_FROM_XML, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
#include <config.h>
#include "xmlrpc.h"
-#include "internal.h"
+#include "virterror_internal.h"
#include "memory.h"
#include <libxml/nanohttp.h>
if (error == VIR_ERR_OK)
return;
- errmsg = __virErrorMsg(error, info);
- __virRaiseError(NULL, NULL, NULL, VIR_FROM_RPC, error, VIR_ERR_ERROR,
+ errmsg = virErrorMsg(error, info);
+ virRaiseError(NULL, NULL, NULL, VIR_FROM_RPC, error, VIR_ERR_ERROR,
errmsg, info, NULL, value, 0, errmsg, info, value);
}
#include <xs.h>
-#include "internal.h"
+#include "virterror_internal.h"
#include "driver.h"
#include "xen_unified.h"
#include "xs_internal.h"
#endif /* ! PROXY */
#define virXenStoreError(conn, code, fmt...) \
- __virReportErrorHelper(NULL, VIR_FROM_XENSTORE, code, __FILE__, \
+ virReportErrorHelper(NULL, VIR_FROM_XENSTORE, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
/************************************************************************