uint64_t free_mem;
if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create log dir '%s': %s"),
- cfg->logDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create log dir '%s'"),
+ cfg->logDir);
return -1;
}
libxl_driver->config = cfg;
if (g_mkdir_with_parents(cfg->stateDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create state dir '%s': %s"),
- cfg->stateDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create state dir '%s'"),
+ cfg->stateDir);
goto error;
}
if (g_mkdir_with_parents(cfg->libDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create lib dir '%s': %s"),
- cfg->libDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create lib dir '%s'"),
+ cfg->libDir);
goto error;
}
if (g_mkdir_with_parents(cfg->saveDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create save dir '%s': %s"),
- cfg->saveDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create save dir '%s'"),
+ cfg->saveDir);
goto error;
}
if (g_mkdir_with_parents(cfg->autoDumpDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create dump dir '%s': %s"),
- cfg->autoDumpDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create dump dir '%s'"),
+ cfg->autoDumpDir);
goto error;
}
if (g_mkdir_with_parents(cfg->channelDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create channel dir '%s': %s"),
- cfg->channelDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create channel dir '%s'"),
+ cfg->channelDir);
goto error;
}
virCommandAbort(cmd);
if (errbuf && *errbuf)
- errstr = g_strdup_printf("\nstderr=%s", errbuf);
+ errstr = g_strdup_printf("stderr=%s", errbuf);
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: failed to communicate with bridge helper: %s%s"),
- cmdstr, g_strerror(errno),
- NULLSTR_EMPTY(errstr));
+ virReportSystemError(errno,
+ _("%s: failed to communicate with bridge helper: %s"),
+ cmdstr,
+ NULLSTR_EMPTY(errstr));
VIR_FREE(errstr);
goto cleanup;
}