Fri Feb 16 18:28:32 IST 2007 Mark McLoughlin <markmc@redhat.com>

* qemud/qemud.c, qemud/dispatch.c, qemud/internal.h
        qemud/conf.c, qemud/driver.c, configure.in: add a
        qemudLog() function which uses syslog() if we're in daemon
        mode, doesn't output INFO/DEBUG messages unless the
        verbose flag is set and doesn't output DEBUG messages
        unless compiled with --enable-debug. Also, make a first
        pass through fatal errors and add error messages for them.
This commit is contained in:
Mark McLoughlin
2007-02-16 18:30:55 +00:00
parent 49fe28206a
commit cfa655f9b8
7 changed files with 240 additions and 89 deletions

View File

@@ -812,7 +812,7 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
struct qemud_packet *in, struct qemud_packet *out) {
clientFunc *funcs;
unsigned int type = in->header.type;
QEMUD_DEBUG("> Dispatching request %d readonly ? %d\n", type, client->readonly);
qemudDebug("> Dispatching request %d readonly ? %d", type, client->readonly);
server->errorCode = 0;
server->errorMessage[0] = '\0';
@@ -820,12 +820,12 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
memset(out, 0, sizeof(struct qemud_packet));
if (type >= QEMUD_PKT_MAX) {
QEMUD_DEBUG("Illegal request type\n");
qemudDebug("Illegal request type");
return -1;
}
if (type == QEMUD_PKT_FAILURE) {
QEMUD_DEBUG("Illegal request type\n");
qemudDebug("Illegal request type");
return -1;
}
@@ -835,17 +835,17 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
funcs = funcsTransmitRW;
if (!funcs[type]) {
QEMUD_DEBUG("Illegal operation requested\n");
qemudDebug("Illegal operation requested");
qemudReportError(server, VIR_ERR_OPERATION_DENIED, NULL);
qemudDispatchFailure(server, client, out);
} else {
if ((funcs[type])(server, client, in, out) < 0) {
QEMUD_DEBUG("Dispatch failed\n");
qemudDebug("Dispatch failed");
return -1;
}
}
QEMUD_DEBUG("< Returning reply %d (%d bytes)\n",
qemudDebug("< Returning reply %d (%d bytes)",
out->header.type,
out->header.dataSize);