diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b6d1bf16214905bd58518f3a5041949735bac996..7715cadbdc2550652cf206d5a3ae2fcae8cf4128 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25701,13 +25701,13 @@ virDomainDefHasMemballoon(const virDomainDef *def) * Shorten domain name to avoid possible path length limitations. */ char * -virDomainObjGetShortName(virDomainObjPtr vm) +virDomainObjGetShortName(const virDomainDef *def) { const int dommaxlen = 20; char *ret = NULL; ignore_value(virAsprintf(&ret, "%d-%.*s", - vm->def->id, dommaxlen, vm->def->name)); + def->id, dommaxlen, def->name)); return ret; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 747c11e3d72da0a5709c159be4466eda44fb6592..c9f2bf3d9b88e4bcca257d509d45270f948003d7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3205,7 +3205,7 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def, bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1); -char *virDomainObjGetShortName(virDomainObjPtr vm); +char *virDomainObjGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1); int virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4aae14d9d10365d49c29faa1d22e73e71ab76ace..d3e505b17639f1125e68b3d1c632bffb9a6cc073 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1475,7 +1475,7 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver, { virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); qemuDomainObjPrivatePtr priv = vm->privateData; - char *domname = virDomainObjGetShortName(vm); + char *domname = virDomainObjGetShortName(vm->def); int ret = -1; if (!domname) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6b177e9e5b250ecaa832b664db221a33a8c98f15..3f4e06bc3fdc501766b99a379832dac560fcc3d7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3885,7 +3885,7 @@ getAutoDumpPath(virQEMUDriverPtr driver, virDomainObjPtr vm) { char *dumpfile = NULL; - char *domname = virDomainObjGetShortName(vm); + char *domname = virDomainObjGetShortName(vm->def); char timestr[100]; struct tm time_info; time_t curtime = time(NULL);