1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

qemu: Shorten domain name for watchdog coredump

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

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1334237

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2016-06-13 16:28:06 +02:00
parent e6001cc557
commit ab74f60a36

View File

@ -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);
}