virLogDaemonPtr logd;
virNetServerPtr srv = NULL;
- if (VIR_ALLOC(logd) < 0)
- return NULL;
+ logd = g_new0(virLogDaemon, 1);
g_mutex_init(&logd->lock);
virJSONValuePtr child;
const char *serverNames[] = { "virtlogd" };
- if (VIR_ALLOC(logd) < 0)
- return NULL;
+ logd = g_new0(virLogDaemon, 1);
g_mutex_init(&logd->lock);
unsigned long long timestamp;
bool privileged = opaque != NULL;
- if (VIR_ALLOC(priv) < 0)
- return NULL;
+ priv = g_new0(virLogDaemonClient, 1);
g_mutex_init(&priv->lock);
{
virLogDaemonConfigPtr data;
- if (VIR_ALLOC(data) < 0)
- return NULL;
+ data = g_new0(virLogDaemonConfig, 1);
data->max_clients = 1024;
data->admin_max_clients = 5000;
const char *domuuid;
const char *tmp;
- if (VIR_ALLOC(file) < 0)
- return NULL;
+ file = g_new0(virLogHandlerLogFile, 1);
handler->inhibitor(true, handler->opaque);
if (virPipe(pipefd) < 0)
goto error;
- if (VIR_ALLOC(file) < 0)
- goto error;
+ file = g_new0(virLogHandlerLogFile, 1);
file->watch = -1;
file->pipefd = pipefd[0];
if (virRotatingFileReaderSeek(file, inode, offset) < 0)
goto error;
- if (VIR_ALLOC_N(data, maxlen + 1) < 0)
- goto error;
+ data = g_new0(char, maxlen + 1);
got = virRotatingFileReaderConsume(file, data, maxlen);
if (got < 0)
{
virLogManagerPtr mgr;
- if (VIR_ALLOC(mgr) < 0)
- goto error;
+ mgr = g_new0(virLogManager, 1);
if (!(mgr->client = virLogManagerConnect(privileged, &mgr->program)))
goto error;