提交 d294f6b0 编写于 作者: M Martin Kletzander

Shorten domain name for automatic coredump

If the domain name is long enough, the timestamp can prolong the
filename for automatic coredump to more than the filesystem's limit.
Simply shorten it like we do in other places.  The timestamp helps with
the unification, but having the ID in the name won't hurt.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1289363Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 a042275a
......@@ -3965,13 +3965,17 @@ doCoreDumpToAutoDumpPath(virQEMUDriverPtr driver,
char timestr[100];
struct tm time_info;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
char *domname = virDomainObjGetShortName(vm);
if (!domname)
goto cleanup;
localtime_r(&curtime, &time_info);
strftime(timestr, sizeof(timestr), "%Y-%m-%d-%H:%M:%S", &time_info);
if (virAsprintf(&dumpfile, "%s/%s-%s",
cfg->autoDumpPath,
vm->def->name,
domname,
timestr) < 0)
goto cleanup;
......@@ -3984,6 +3988,7 @@ doCoreDumpToAutoDumpPath(virQEMUDriverPtr driver,
"%s", _("Dump failed"));
cleanup:
VIR_FREE(dumpfile);
VIR_FREE(domname);
virObjectUnref(cfg);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册