So far this function takes virDomainObjPtr which: 1) is an overkill, 2) might be not available in all the places we will use it. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/conf/domain_conf.c | 4 ++-- src/conf/domain_conf.h | 2 +- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_driver.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5d2bc8d..4361abf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25713,13 +25713,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 3dfd780..1d094ae 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3202,7 +3202,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 47332a8..35c6cb0 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 3517aa2..29ed16e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3880,7 +3880,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); -- 2.8.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list