#ifdef DEBUG_RECEIVED
# define DEBUG_REPORT_RECEIVED(buf, len) \
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_DEBUG, "received: '%.*s'", len, buf)
+ LOG(DEBUG, "received: '%.*s'", len, buf)
#else
# define DEBUG_REPORT_RECEIVED(buf, len) ((void)0)
#endif
port = libxl__json_object_get_string(obj);
if (!addr || !port) {
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
- "Failed to retreive VNC connect information.");
+ LOG(ERROR, "Failed to retreive VNC connect information.");
goto out;
}
ret = select(qmp->qmp_fd + 1, &rfds, NULL, NULL, &timeout);
if (ret == 0) {
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR, "timeout");
+ LOG(ERROR, "timeout");
return -1;
} else if (ret < 0) {
if (errno == EINTR)
rd = read(qmp->qmp_fd, qmp->buffer, QMP_RECEIVE_BUFFER_SIZE);
if (rd == 0) {
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR, "Unexpected end of socket");
+ LOG(ERROR, "Unexpected end of socket");
return -1;
} else if (rd < 0) {
LIBXL__LOG_ERRNO(qmp->ctx, LIBXL__LOG_ERROR, "Socket read error");
if (o) {
rc = qmp_handle_response(qmp, o);
} else {
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
- "Parse error of : %s\n", s);
+ LOG(ERROR, "Parse error of : %s\n", s);
return -1;
}
s = yajl_gen_get_buf(hand, &buf, &len);
if (s) {
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
- "Failed to generate a qmp command");
+ LOG(ERROR, "Failed to generate a qmp command");
goto out;
}
ret = libxl__strndup(gc, (const char*)buf, len);
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_DEBUG, "next qmp command: '%s'", buf);
+ LOG(DEBUG, "next qmp command: '%s'", buf);
out:
yajl_gen_free(hand);
return NULL;
}
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_DEBUG, "connected to %s", qmp_socket);
+ LOG(DEBUG, "connected to %s", qmp_socket);
/* Wait for the response to qmp_capabilities */
while (!qmp->connected) {
}
if (!qmp->connected) {
- LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR, "Failed to connect to QMP");
+ LOG(ERROR, "Failed to connect to QMP");
libxl__qmp_close(qmp);
return NULL;
}