summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 69562c3)
raw | patch | inline | side by side (parent: 69562c3)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 10 Dec 2014 15:44:33 +0000 (16:44 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 10 Dec 2014 15:44:33 +0000 (16:44 +0100) |
src/ceph.c | patch | blob | history |
diff --git a/src/ceph.c b/src/ceph.c
index 645c27c98f89b723e0516e445127c35c30774c88..faebb313bf28d14649c362fadf08cdb87e3449ca 100644 (file)
--- a/src/ceph.c
+++ b/src/ceph.c
ds = &ds_array[dset->ds_num++];
snprintf(ds->name, MAX_RRD_DS_NAME_LEN, "%s", ds_name);
ds->type = (pc_type & PERFCOUNTER_DERIVE) ? DS_TYPE_DERIVE : DS_TYPE_GAUGE;
-
+
/**
* Use min of 0 for DERIVE types so we don't get negative values on Ceph
* service restart
int flags, fd, err;
if(io->state != CSTATE_UNCONNECTED)
{
- ERROR("cconn_connect: io->state != CSTATE_UNCONNECTED");
+ ERROR("ceph plugin: cconn_connect: io->state != CSTATE_UNCONNECTED");
return -EDOM;
}
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if(fd < 0)
{
int err = -errno;
- ERROR("cconn_connect: socket(PF_UNIX, SOCK_STREAM, 0) failed: "
- "error %d", err);
+ ERROR("ceph plugin: cconn_connect: socket(PF_UNIX, SOCK_STREAM, 0) "
+ "failed: error %d", err);
return err;
}
memset(&address, 0, sizeof(struct sockaddr_un));
connect(fd, (struct sockaddr *) &address, sizeof(struct sockaddr_un)));
if(err < 0)
{
- ERROR("cconn_connect: connect(%d) failed: error %d", fd, err);
+ ERROR("ceph plugin: cconn_connect: connect(%d) failed: error %d",
+ fd, err);
return err;
}
if(fcntl(fd, F_SETFL, flags | O_NONBLOCK) != 0)
{
err = -errno;
- ERROR("cconn_connect: fcntl(%d, O_NONBLOCK) error %d", fd, err);
+ ERROR("ceph plugin: cconn_connect: fcntl(%d, O_NONBLOCK) error %d",
+ fd, err);
return err;
}
io->asok = fd;
{
if(revents & POLLERR)
{
- ERROR("cconn_validate_revents(name=%s): got POLLERR", io->d->name);
+ ERROR("ceph plugin: cconn_validate_revents(name=%s): got POLLERR",
+ io->d->name);
return -EIO;
}
switch (io->state)
return (revents & POLLIN) ? 0 : -EINVAL;
return (revents & POLLIN) ? 0 : -EINVAL;
default:
- ERROR("cconn_validate_revents(name=%s) got to illegal state on "
- "line %d", io->d->name, __LINE__);
+ ERROR("ceph plugin: cconn_validate_revents(name=%s) got to "
+ "illegal state on line %d", io->d->name, __LINE__);
return -EDOM;
}
}
switch (io->state)
{
case CSTATE_UNCONNECTED:
- ERROR("cconn_handle_event(name=%s) got to illegal state on line "
- "%d", io->d->name, __LINE__);
+ ERROR("ceph plugin: cconn_handle_event(name=%s) got to illegal "
+ "state on line %d", io->d->name, __LINE__);
return -EDOM;
case CSTATE_WRITE_REQUEST:
io->d->version = ntohl(io->d->version);
if(io->d->version != 1)
{
- ERROR("cconn_handle_event(name=%s) not "
- "expecting version %d!", io->d->name, io->d->version);
+ ERROR("ceph plugin: cconn_handle_event(name=%s) not "
+ "expecting version %d!", io->d->name, io->d->version);
return -ENOTSUP;
- }DEBUG("cconn_handle_event(name=%s): identified as "
+ }
+ DEBUG("cconn_handle_event(name=%s): identified as "
"version %d", io->d->name, io->d->version);
io->amt = 0;
cconn_close(io);
io->json = calloc(1, io->json_len + 1);
if(!io->json)
{
- ERROR("ERR CALLOCING IO->JSON");
+ ERROR("ceph plugin: error callocing io->json");
return -ENOMEM;
}
}
return 0;
}
default:
- ERROR("cconn_handle_event(name=%s) got to illegal state on "
- "line %d", io->d->name, __LINE__);
+ ERROR("ceph plugin: cconn_handle_event(name=%s) got to illegal "
+ "state on line %d", io->d->name, __LINE__);
return -EDOM;
}
}
fds->events = POLLIN;
return 1;
default:
- ERROR("cconn_prepare(name=%s) got to illegal state on line %d",
- io->d->name, __LINE__);
+ ERROR("ceph plugin: cconn_prepare(name=%s) got to illegal state "
+ "on line %d", io->d->name, __LINE__);
return -EDOM;
}
}
ret = cconn_prepare(io, fds + nfds);
if(ret < 0)
{
- WARNING("ERROR: cconn_prepare(name=%s,i=%d,st=%d)=%d",
+ WARNING("ceph plugin: cconn_prepare(name=%s,i=%d,st=%d)=%d",
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
{
/* Timed out */
ret = -ETIMEDOUT;
- WARNING("ERROR: cconn_main_loop: timed out.\n");
+ WARNING("ceph plugin: cconn_main_loop: timed out.");
goto done;
}
RETRY_ON_EINTR(ret, poll(fds, nfds, diff));
if(ret < 0)
{
- ERROR("poll(2) error: %d", ret);
+ ERROR("ceph plugin: poll(2) error: %d", ret);
goto done;
}
for(i = 0; i < nfds; ++i)
}
else if(cconn_validate_revents(io, revents))
{
- WARNING("ERROR: cconn(name=%s,i=%d,st=%d): "
+ WARNING("ceph plugin: cconn(name=%s,i=%d,st=%d): "
"revents validation error: "
"revents=0x%08x", io->d->name, i, io->state, revents);
cconn_close(io);
int ret = cconn_handle_event(io);
if(ret)
{
- WARNING("ERROR: cconn_handle_event(name=%s,"
+ WARNING("ceph plugin: cconn_handle_event(name=%s,"
"i=%d,st=%d): error %d", io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
ret = plugin_register_data_set(d->dset + j);
if(ret)
{
- ERROR("plugin_register_data_set(%s) failed!", d->name);
+ ERROR("ceph plugin: plugin_register_data_set(%s) failed!",
+ d->name);
}
else
{