提交 242e3ea4 编写于 作者: A Andrea Bolognani

qemu: Replace Mlock with MemLock in function names

MemLock is already used in other modules and, while still an
abbreviation, is not ambiguous.
上级 afbe1d4c
...@@ -11287,8 +11287,8 @@ qemuBuildCommandLine(virConnectPtr conn, ...@@ -11287,8 +11287,8 @@ qemuBuildCommandLine(virConnectPtr conn,
/* In some situations, eg. VFIO passthrough, QEMU might need to lock a /* In some situations, eg. VFIO passthrough, QEMU might need to lock a
* significant amount of memory, so we need to set the limit accordingly */ * significant amount of memory, so we need to set the limit accordingly */
if (qemuDomainRequiresMlock(def)) if (qemuDomainRequiresMemLock(def))
virCommandSetMaxMemLock(cmd, qemuDomainGetMlockLimitBytes(def)); virCommandSetMaxMemLock(cmd, qemuDomainGetMemLockLimitBytes(def));
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MSG_TIMESTAMP) && if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MSG_TIMESTAMP) &&
cfg->logTimestamp) cfg->logTimestamp)
......
...@@ -3964,7 +3964,7 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, ...@@ -3964,7 +3964,7 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
/** /**
* qemuDomainGetMlockLimitBytes: * qemuDomainGetMemLockLimitBytes:
* *
* @def: domain definition * @def: domain definition
* *
...@@ -3974,7 +3974,7 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, ...@@ -3974,7 +3974,7 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
* value returned may depend upon the architecture or devices present. * value returned may depend upon the architecture or devices present.
*/ */
unsigned long long unsigned long long
qemuDomainGetMlockLimitBytes(virDomainDefPtr def) qemuDomainGetMemLockLimitBytes(virDomainDefPtr def)
{ {
unsigned long long memKB; unsigned long long memKB;
...@@ -4095,7 +4095,7 @@ qemuDomainGetMlockLimitBytes(virDomainDefPtr def) ...@@ -4095,7 +4095,7 @@ qemuDomainGetMlockLimitBytes(virDomainDefPtr def)
* requirements. * requirements.
* */ * */
bool bool
qemuDomainRequiresMlock(virDomainDefPtr def) qemuDomainRequiresMemLock(virDomainDefPtr def)
{ {
size_t i; size_t i;
...@@ -4138,7 +4138,7 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm) ...@@ -4138,7 +4138,7 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm)
unsigned long long bytes = 0; unsigned long long bytes = 0;
int ret = -1; int ret = -1;
if (qemuDomainRequiresMlock(vm->def)) { if (qemuDomainRequiresMemLock(vm->def)) {
/* If this is the first time adjusting the limit, save the current /* If this is the first time adjusting the limit, save the current
* value so that we can restore it once memory locking is no longer * value so that we can restore it once memory locking is no longer
* required. Failing to obtain the current limit is not a critical * required. Failing to obtain the current limit is not a critical
...@@ -4147,7 +4147,7 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm) ...@@ -4147,7 +4147,7 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm)
if (virProcessGetMaxMemLock(vm->pid, &(vm->original_memlock)) < 0) if (virProcessGetMaxMemLock(vm->pid, &(vm->original_memlock)) < 0)
vm->original_memlock = 0; vm->original_memlock = 0;
} }
bytes = qemuDomainGetMlockLimitBytes(vm->def); bytes = qemuDomainGetMemLockLimitBytes(vm->def);
} else { } else {
/* Once memory locking is no longer required, we can restore the /* Once memory locking is no longer required, we can restore the
* original, usually very low, limit */ * original, usually very low, limit */
......
...@@ -498,8 +498,8 @@ bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def); ...@@ -498,8 +498,8 @@ bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
virDomainObjPtr vm); virDomainObjPtr vm);
unsigned long long qemuDomainGetMlockLimitBytes(virDomainDefPtr def); unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDefPtr def);
bool qemuDomainRequiresMlock(virDomainDefPtr def); bool qemuDomainRequiresMemLock(virDomainDefPtr def);
int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm); int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm);
int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def, int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册