VIR_FREE(cfg->stateDir);
VIR_FREE(cfg->libDir);
VIR_FREE(cfg->saveDir);
+ VIR_FREE(cfg->autoDumpDir);
}
static int
goto error;
if (VIR_STRDUP(cfg->saveDir, LIBXL_SAVE_DIR) < 0)
goto error;
+ if (VIR_STRDUP(cfg->autoDumpDir, LIBXL_DUMP_DIR) < 0)
+ goto error;
if (virAsprintf(&log_file, "%s/libxl-driver.log", cfg->logDir) < 0)
goto error;
# define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl"
# define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
+# define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
# define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub"
char *stateDir;
char *libDir;
char *saveDir;
+ char *autoDumpDir;
};
virStrerror(errno, ebuf, sizeof(ebuf)));
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 */
libxl_driver->hostsysinfo = virSysinfoRead();