提交 3e5b35a5 编写于 作者: J Jovanka Gulicoska 提交者: Cole Robinson

qemu: Replace some VIR_ERROR with vir*Error

qemuStateInitialize uses a mix of VIR_ERROR and standard vir*Error
calls. Prefer the standard vir*Error
上级 2c20574d
...@@ -633,7 +633,6 @@ qemuStateInitialize(bool privileged, ...@@ -633,7 +633,6 @@ qemuStateInitialize(bool privileged,
{ {
char *driverConf = NULL; char *driverConf = NULL;
virConnectPtr conn = NULL; virConnectPtr conn = NULL;
char ebuf[1024];
virQEMUDriverConfigPtr cfg; virQEMUDriverConfigPtr cfg;
uid_t run_uid = -1; uid_t run_uid = -1;
gid_t run_gid = -1; gid_t run_gid = -1;
...@@ -644,7 +643,8 @@ qemuStateInitialize(bool privileged, ...@@ -644,7 +643,8 @@ qemuStateInitialize(bool privileged,
return -1; return -1;
if (virMutexInit(&qemu_driver->lock) < 0) { if (virMutexInit(&qemu_driver->lock) < 0) {
VIR_ERROR(_("cannot initialize mutex")); virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize mutex"));
VIR_FREE(qemu_driver); VIR_FREE(qemu_driver);
return -1; return -1;
} }
...@@ -677,44 +677,43 @@ qemuStateInitialize(bool privileged, ...@@ -677,44 +677,43 @@ qemuStateInitialize(bool privileged,
VIR_FREE(driverConf); VIR_FREE(driverConf);
if (virFileMakePath(cfg->stateDir) < 0) { if (virFileMakePath(cfg->stateDir) < 0) {
VIR_ERROR(_("Failed to create state dir '%s': %s"), virReportSystemError(errno, _("Failed to create state dir %s"),
cfg->stateDir, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->stateDir);
goto error; goto error;
} }
if (virFileMakePath(cfg->libDir) < 0) { if (virFileMakePath(cfg->libDir) < 0) {
VIR_ERROR(_("Failed to create lib dir '%s': %s"), virReportSystemError(errno, _("Failed to create lib dir %s"),
cfg->libDir, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->libDir);
goto error; goto error;
} }
if (virFileMakePath(cfg->cacheDir) < 0) { if (virFileMakePath(cfg->cacheDir) < 0) {
VIR_ERROR(_("Failed to create cache dir '%s': %s"), virReportSystemError(errno, _("Failed to create cache dir %s"),
cfg->cacheDir, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->cacheDir);
goto error; goto error;
} }
if (virFileMakePath(cfg->saveDir) < 0) { if (virFileMakePath(cfg->saveDir) < 0) {
VIR_ERROR(_("Failed to create save dir '%s': %s"), virReportSystemError(errno, _("Failed to create save dir %s"),
cfg->saveDir, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->saveDir);
goto error; goto error;
} }
if (virFileMakePath(cfg->snapshotDir) < 0) { if (virFileMakePath(cfg->snapshotDir) < 0) {
VIR_ERROR(_("Failed to create save dir '%s': %s"), virReportSystemError(errno, _("Failed to create save dir %s"),
cfg->snapshotDir, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->snapshotDir);
goto error; goto error;
} }
if (virFileMakePath(cfg->autoDumpPath) < 0) { if (virFileMakePath(cfg->autoDumpPath) < 0) {
VIR_ERROR(_("Failed to create dump dir '%s': %s"), virReportSystemError(errno, _("Failed to create dump dir %s"),
cfg->autoDumpPath, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->autoDumpPath);
goto error; goto error;
} }
if (virFileMakePath(cfg->channelTargetDir) < 0) { if (virFileMakePath(cfg->channelTargetDir) < 0) {
VIR_ERROR(_("Failed to create channel target dir '%s': %s"), virReportSystemError(errno, _("Failed to create channel target dir %s"),
cfg->channelTargetDir, cfg->channelTargetDir);
virStrerror(errno, ebuf, sizeof(ebuf)));
goto error; goto error;
} }
if (virFileMakePath(cfg->nvramDir) < 0) { if (virFileMakePath(cfg->nvramDir) < 0) {
VIR_ERROR(_("Failed to create nvram dir '%s': %s"), virReportSystemError(errno, _("Failed to create nvram dir %s"),
cfg->nvramDir, virStrerror(errno, ebuf, sizeof(ebuf))); cfg->nvramDir);
goto error; goto error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册