Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b3038773
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
b3038773
编写于
5月 25, 2016
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Remove virDomainLiveConfigHelperMethod from qemuDomainSetMemoryParameters
上级
62a73bf6
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
19 deletion
+13
-19
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+13
-19
未找到文件。
src/qemu/qemu_driver.c
浏览文件 @
b3038773
...
@@ -9497,6 +9497,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9497,6 +9497,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
unsigned int flags)
unsigned int flags)
{
{
virQEMUDriverPtr driver = dom->conn->privateData;
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainDefPtr def = NULL;
virDomainDefPtr persistentDef = NULL;
virDomainDefPtr persistentDef = NULL;
virDomainObjPtr vm = NULL;
virDomainObjPtr vm = NULL;
unsigned long long swap_hard_limit;
unsigned long long swap_hard_limit;
...
@@ -9508,7 +9509,6 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9508,7 +9509,6 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
virQEMUDriverConfigPtr cfg = NULL;
virQEMUDriverConfigPtr cfg = NULL;
int rc;
int rc;
int ret = -1;
int ret = -1;
virCapsPtr caps = NULL;
qemuDomainObjPrivatePtr priv;
qemuDomainObjPrivatePtr priv;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
...
@@ -9540,23 +9540,18 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9540,23 +9540,18 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
goto cleanup;
goto cleanup;
}
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
goto cleanup;
if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0)
&persistentDef) < 0)
goto endjob;
goto endjob;
if (
flags & VIR_DOMAIN_AFFECT_LIVE) {
if (
def &&
if (
!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_MEMORY)) {
!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_MEMORY)) {
virReportError(VIR_ERR_OPERATION_INVALID
,
virReportError(VIR_ERR_OPERATION_INVALID, "%s"
,
"%s",
_("cgroup memory controller is not mounted"));
_("cgroup memory controller is not mounted"));
goto endjob;
goto endjob;
}
}
}
#define VIR_GET_LIMIT_PARAMETER(PARAM, VALUE) \
#define VIR_GET_LIMIT_PARAMETER(PARAM, VALUE) \
if ((rc = virTypedParamsGetULLong(params, nparams, PARAM, &VALUE)) < 0) \
if ((rc = virTypedParamsGetULLong(params, nparams, PARAM, &VALUE)) < 0) \
...
@@ -9592,13 +9587,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9592,13 +9587,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
#define QEMU_SET_MEM_PARAMETER(FUNC, VALUE) \
#define QEMU_SET_MEM_PARAMETER(FUNC, VALUE) \
if (set_ ## VALUE) { \
if (set_ ## VALUE) { \
if (
flags & VIR_DOMAIN_AFFECT_LIVE) {
\
if (
def) {
\
if ((rc = FUNC(priv->cgroup, VALUE)) < 0) \
if ((rc = FUNC(priv->cgroup, VALUE)) < 0) \
goto endjob; \
goto endjob; \
vm->def->mem.VALUE = VALUE;
\
def->mem.VALUE = VALUE;
\
} \
} \
\
\
if (
flags & VIR_DOMAIN_AFFECT_CONFIG)
\
if (
persistentDef)
\
persistentDef->mem.VALUE = VALUE; \
persistentDef->mem.VALUE = VALUE; \
}
}
...
@@ -9606,7 +9601,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9606,7 +9601,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
QEMU_SET_MEM_PARAMETER(virCgroupSetMemorySoftLimit, soft_limit);
QEMU_SET_MEM_PARAMETER(virCgroupSetMemorySoftLimit, soft_limit);
/* set hard limit before swap hard limit if decreasing it */
/* set hard limit before swap hard limit if decreasing it */
if (
vm->
def->mem.hard_limit > hard_limit) {
if (
def &&
def->mem.hard_limit > hard_limit) {
QEMU_SET_MEM_PARAMETER(virCgroupSetMemoryHardLimit, hard_limit);
QEMU_SET_MEM_PARAMETER(virCgroupSetMemoryHardLimit, hard_limit);
/* inhibit changing the limit a second time */
/* inhibit changing the limit a second time */
set_hard_limit = false;
set_hard_limit = false;
...
@@ -9619,11 +9614,11 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9619,11 +9614,11 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
#undef QEMU_SET_MEM_PARAMETER
#undef QEMU_SET_MEM_PARAMETER
if (
flags & VIR_DOMAIN_AFFECT_LIVE
&&
if (
def
&&
virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
goto endjob;
goto endjob;
if (
flags & VIR_DOMAIN_AFFECT_CONFIG
&&
if (
persistentDef
&&
virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
goto endjob;
goto endjob;
...
@@ -9634,7 +9629,6 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
...
@@ -9634,7 +9629,6 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
cleanup:
cleanup:
virDomainObjEndAPI(&vm);
virDomainObjEndAPI(&vm);
virObjectUnref(caps);
virObjectUnref(cfg);
virObjectUnref(cfg);
return ret;
return ret;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录