提交 c2de456e 编写于 作者: J Jim Fehlig

libxl: add dump dir to libxlDriverConfig object

Signed-off-by: NJim Fehlig <jfehlig@suse.com>
上级 51b9b391
...@@ -97,6 +97,7 @@ libxlDriverConfigDispose(void *obj) ...@@ -97,6 +97,7 @@ libxlDriverConfigDispose(void *obj)
VIR_FREE(cfg->stateDir); VIR_FREE(cfg->stateDir);
VIR_FREE(cfg->libDir); VIR_FREE(cfg->libDir);
VIR_FREE(cfg->saveDir); VIR_FREE(cfg->saveDir);
VIR_FREE(cfg->autoDumpDir);
} }
static int static int
...@@ -1078,6 +1079,8 @@ libxlDriverConfigNew(void) ...@@ -1078,6 +1079,8 @@ libxlDriverConfigNew(void)
goto error; goto error;
if (VIR_STRDUP(cfg->saveDir, LIBXL_SAVE_DIR) < 0) if (VIR_STRDUP(cfg->saveDir, LIBXL_SAVE_DIR) < 0)
goto error; goto error;
if (VIR_STRDUP(cfg->autoDumpDir, LIBXL_DUMP_DIR) < 0)
goto error;
if (virAsprintf(&log_file, "%s/libxl-driver.log", cfg->logDir) < 0) if (virAsprintf(&log_file, "%s/libxl-driver.log", cfg->logDir) < 0)
goto error; goto error;
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
# define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl" # define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl"
# define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl" # define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save" # define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
# define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
# define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub" # define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub"
...@@ -82,6 +83,7 @@ struct _libxlDriverConfig { ...@@ -82,6 +83,7 @@ struct _libxlDriverConfig {
char *stateDir; char *stateDir;
char *libDir; char *libDir;
char *saveDir; char *saveDir;
char *autoDumpDir;
}; };
......
...@@ -977,6 +977,13 @@ libxlStateInitialize(bool privileged, ...@@ -977,6 +977,13 @@ libxlStateInitialize(bool privileged,
virStrerror(errno, ebuf, sizeof(ebuf))); virStrerror(errno, ebuf, sizeof(ebuf)));
goto error; goto error;
} }
if (virFileMakePath(cfg->autoDumpDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create dump dir '%s': %s"),
cfg->autoDumpDir,
virStrerror(errno, ebuf, sizeof(ebuf)));
goto error;
}
/* read the host sysinfo */ /* read the host sysinfo */
libxl_driver->hostsysinfo = virSysinfoRead(); libxl_driver->hostsysinfo = virSysinfoRead();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册