diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9783c9d27e..e8d47a41cd 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4099,6 +4099,7 @@ static char * getAutoDumpPath(virQEMUDriverPtr driver, virDomainObjPtr vm) { + const char *root = driver->embeddedRoot; g_autofree char *domname = virDomainDefGetShortName(vm->def); g_autoptr(GDateTime) now = g_date_time_new_now_local(); g_autofree char *nowstr = NULL; @@ -4111,6 +4112,11 @@ getAutoDumpPath(virQEMUDriverPtr driver, nowstr = g_date_time_format(now, "%Y-%m-%d-%H:%M:%S"); + if (root && !STRPREFIX(cfg->autoDumpPath, root)) { + g_autofree char * hash = virDomainDriverGenerateRootHash(QEMU_DRIVER_NAME, root); + return g_strdup_printf("%s/%s-%s-%s", cfg->autoDumpPath, hash, domname, nowstr); + } + return g_strdup_printf("%s/%s-%s", cfg->autoDumpPath, domname, nowstr); }