mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
d599fc3d57
commit
f035f24777
@ -3222,7 +3222,8 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
|
|||||||
} else {
|
} else {
|
||||||
/* We can have both pagesize and mem source. If that's the case,
|
/* We can have both pagesize and mem source. If that's the case,
|
||||||
* prefer hugepages as those are more specific. */
|
* 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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7116,7 +7117,7 @@ qemuBuildMemPathStr(const virDomainDef *def,
|
|||||||
return -1;
|
return -1;
|
||||||
prealloc = true;
|
prealloc = true;
|
||||||
} else if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) {
|
} 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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1736,9 +1736,9 @@ qemuDomainSecretPrepare(virQEMUDriver *driver,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
|
qemuDomainGenerateMemoryBackingPath(qemuDomainObjPrivate *priv,
|
||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
char **path)
|
char **path)
|
||||||
{
|
{
|
||||||
virQEMUDriver *driver = priv->driver;
|
virQEMUDriver *driver = priv->driver;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||||
@ -1760,7 +1760,7 @@ qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuGetMemoryBackingPath:
|
* qemuDomainGetMemoryBackingPath:
|
||||||
* @priv: domain private data
|
* @priv: domain private data
|
||||||
* @alias: memory object alias
|
* @alias: memory object alias
|
||||||
* @memPath: constructed path
|
* @memPath: constructed path
|
||||||
@ -1771,9 +1771,9 @@ qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv,
|
|||||||
* -1 otherwise (with error reported).
|
* -1 otherwise (with error reported).
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv,
|
qemuDomainGetMemoryBackingPath(qemuDomainObjPrivate *priv,
|
||||||
const char *alias,
|
const char *alias,
|
||||||
char **memPath)
|
char **memPath)
|
||||||
{
|
{
|
||||||
if (!alias) {
|
if (!alias) {
|
||||||
/* This should never happen (TM) */
|
/* This should never happen (TM) */
|
||||||
@ -1804,8 +1804,8 @@ qemuDomainSetPrivatePathsOld(virQEMUDriver *driver,
|
|||||||
cfg->channelTargetDir, vm->def->name);
|
cfg->channelTargetDir, vm->def->name);
|
||||||
|
|
||||||
if (!priv->memoryBackingDir &&
|
if (!priv->memoryBackingDir &&
|
||||||
qemuGetMemoryBackingDomainPath(priv, vm->def,
|
qemuDomainGenerateMemoryBackingPath(priv, vm->def,
|
||||||
&priv->memoryBackingDir) < 0)
|
&priv->memoryBackingDir) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1831,8 +1831,8 @@ qemuDomainSetPrivatePaths(virQEMUDriver *driver,
|
|||||||
cfg->channelTargetDir, domname);
|
cfg->channelTargetDir, domname);
|
||||||
|
|
||||||
if (!priv->memoryBackingDir &&
|
if (!priv->memoryBackingDir &&
|
||||||
qemuGetMemoryBackingDomainPath(priv, vm->def,
|
qemuDomainGenerateMemoryBackingPath(priv, vm->def,
|
||||||
&priv->memoryBackingDir) < 0)
|
&priv->memoryBackingDir) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -939,9 +939,9 @@ void qemuDomainCleanupStorageSourceFD(virStorageSource *src);
|
|||||||
void qemuDomainStartupCleanup(virDomainObj *vm);
|
void qemuDomainStartupCleanup(virDomainObj *vm);
|
||||||
|
|
||||||
|
|
||||||
int qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv,
|
int qemuDomainGetMemoryBackingPath(qemuDomainObjPrivate *priv,
|
||||||
const char *alias,
|
const char *alias,
|
||||||
char **memPath);
|
char **memPath);
|
||||||
|
|
||||||
int qemuDomainSecretPrepare(virQEMUDriver *driver,
|
int qemuDomainSecretPrepare(virQEMUDriver *driver,
|
||||||
virDomainObj *vm)
|
virDomainObj *vm)
|
||||||
|
@ -4110,7 +4110,8 @@ qemuProcessDestroyMemoryBackingPath(virDomainObj *vm,
|
|||||||
{
|
{
|
||||||
g_autofree char *path = NULL;
|
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;
|
return -1;
|
||||||
|
|
||||||
if (unlink(path) < 0 &&
|
if (unlink(path) < 0 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user