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

qemu: Shorten domain name for watchdog coredump

Similarly to commit d294f6b0, if the name is long enough, the
filename can be longer than filesystem's limit.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1334237Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 e6001cc5
......@@ -3906,6 +3906,10 @@ static void processWatchdogEvent(virQEMUDriverPtr driver, virDomainObjPtr vm, in
{
int ret;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
char *domname = virDomainObjGetShortName(vm);
if (!domname)
goto cleanup;
switch (action) {
case VIR_DOMAIN_WATCHDOG_ACTION_DUMP:
......@@ -3915,7 +3919,7 @@ static void processWatchdogEvent(virQEMUDriverPtr driver, virDomainObjPtr vm, in
if (virAsprintf(&dumpfile, "%s/%s-%u",
cfg->autoDumpPath,
vm->def->name,
domname,
(unsigned int)time(NULL)) < 0)
goto cleanup;
......@@ -3959,6 +3963,7 @@ static void processWatchdogEvent(virQEMUDriverPtr driver, virDomainObjPtr vm, in
qemuDomainObjEndAsyncJob(driver, vm);
cleanup:
VIR_FREE(domname);
virObjectUnref(cfg);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册