qemu: Rename memory path functions

This way they make sense not only based on where they are located but
the name also relates to what they are actually doing.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Martin Kletzander 2024-09-23 11:05:49 +02:00
parent d599fc3d57
commit f035f24777
4 changed files with 19 additions and 17 deletions

View File

@ -3222,7 +3222,8 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
} else {
/* We can have both pagesize and mem source. If that's the case,
* prefer hugepages as those are more specific. */
if (qemuGetMemoryBackingPath(priv, mem->info.alias, &memPath) < 0)
if (qemuDomainGetMemoryBackingPath(priv, mem->info.alias,
&memPath) < 0)
return -1;
}
@ -7116,7 +7117,7 @@ qemuBuildMemPathStr(const virDomainDef *def,
return -1;
prealloc = true;
} else if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) {
if (qemuGetMemoryBackingPath(priv, "ram", &mem_path) < 0)
if (qemuDomainGetMemoryBackingPath(priv, "ram", &mem_path) < 0)
return -1;
}

View File

@ -1736,7 +1736,7 @@ qemuDomainSecretPrepare(virQEMUDriver *driver,
static int
qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
qemuDomainGenerateMemoryBackingPath(qemuDomainObjPrivate *priv,
const virDomainDef *def,
char **path)
{
@ -1760,7 +1760,7 @@ qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
/**
* qemuGetMemoryBackingPath:
* qemuDomainGetMemoryBackingPath:
* @priv: domain private data
* @alias: memory object alias
* @memPath: constructed path
@ -1771,7 +1771,7 @@ qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
* -1 otherwise (with error reported).
*/
int
qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv,
qemuDomainGetMemoryBackingPath(qemuDomainObjPrivate *priv,
const char *alias,
char **memPath)
{
@ -1804,7 +1804,7 @@ qemuDomainSetPrivatePathsOld(virQEMUDriver *driver,
cfg->channelTargetDir, vm->def->name);
if (!priv->memoryBackingDir &&
qemuGetMemoryBackingDomainPath(priv, vm->def,
qemuDomainGenerateMemoryBackingPath(priv, vm->def,
&priv->memoryBackingDir) < 0)
return -1;
@ -1831,7 +1831,7 @@ qemuDomainSetPrivatePaths(virQEMUDriver *driver,
cfg->channelTargetDir, domname);
if (!priv->memoryBackingDir &&
qemuGetMemoryBackingDomainPath(priv, vm->def,
qemuDomainGenerateMemoryBackingPath(priv, vm->def,
&priv->memoryBackingDir) < 0)
return -1;

View File

@ -939,7 +939,7 @@ void qemuDomainCleanupStorageSourceFD(virStorageSource *src);
void qemuDomainStartupCleanup(virDomainObj *vm);
int qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv,
int qemuDomainGetMemoryBackingPath(qemuDomainObjPrivate *priv,
const char *alias,
char **memPath);

View File

@ -4110,7 +4110,8 @@ qemuProcessDestroyMemoryBackingPath(virDomainObj *vm,
{
g_autofree char *path = NULL;
if (qemuGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm), mem->info.alias, &path) < 0)
if (qemuDomainGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm),
mem->info.alias, &path) < 0)
return -1;
if (unlink(path) < 0 &&