Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e6e14468
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看板
提交
e6e14468
编写于
5月 25, 2016
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf: Change virDomainCputune member 'shares' to unsigned long long
cgroup functions set and get the longer type so use it everywhere
上级
8bf8838f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
8 deletion
+8
-8
src/conf/domain_conf.c
src/conf/domain_conf.c
+3
-3
src/conf/domain_conf.h
src/conf/domain_conf.h
+1
-1
src/lxc/lxc_native.c
src/lxc/lxc_native.c
+1
-1
src/vmx/vmx.c
src/vmx/vmx.c
+3
-3
未找到文件。
src/conf/domain_conf.c
浏览文件 @
e6e14468
...
...
@@ -15528,8 +15528,8 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
/* Extract cpu tunables. */
if ((n = virXPathULong("string(./cputune/shares[1])", ctxt,
&def->cputune.shares)) < -1) {
if ((n = virXPathULong
Long
("string(./cputune/shares[1])", ctxt,
&def->cputune.shares)) < -1) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("can't parse cputune shares value"));
goto error;
...
...
@@ -22158,7 +22158,7 @@ virDomainCputuneDefFormat(virBufferPtr buf,
virBufferAdjustIndent(&childrenBuf, virBufferGetIndent(buf, false) + 2);
if (def->cputune.sharesSpecified)
virBufferAsprintf(&childrenBuf, "<shares>%lu</shares>\n",
virBufferAsprintf(&childrenBuf, "<shares>%l
l
u</shares>\n",
def->cputune.shares);
if (def->cputune.period)
virBufferAsprintf(&childrenBuf, "<period>%llu</period>\n",
...
...
src/conf/domain_conf.h
浏览文件 @
e6e14468
...
...
@@ -2011,7 +2011,7 @@ typedef struct _virDomainCputune virDomainCputune;
typedef
virDomainCputune
*
virDomainCputunePtr
;
struct
_virDomainCputune
{
unsigned
long
shares
;
unsigned
long
long
shares
;
bool
sharesSpecified
;
unsigned
long
long
period
;
long
long
quota
;
...
...
src/lxc/lxc_native.c
浏览文件 @
e6e14468
...
...
@@ -800,7 +800,7 @@ lxcSetCpuTune(virDomainDefPtr def, virConfPtr properties)
if
((
value
=
virConfGetValue
(
properties
,
"lxc.cgroup.cpu.shares"
))
&&
value
->
str
)
{
if
(
virStrToLong_ul
(
value
->
str
,
NULL
,
10
,
&
def
->
cputune
.
shares
)
<
0
)
if
(
virStrToLong_ul
l
(
value
->
str
,
NULL
,
10
,
&
def
->
cputune
.
shares
)
<
0
)
goto
error
;
def
->
cputune
.
sharesSpecified
=
true
;
}
...
...
src/vmx/vmx.c
浏览文件 @
e6e14468
...
...
@@ -1547,8 +1547,8 @@ virVMXParseConfig(virVMXContext *ctx,
def
->
cputune
.
shares
=
vcpus
*
1000
;
}
else
if
(
STRCASEEQ
(
sched_cpu_shares
,
"high"
))
{
def
->
cputune
.
shares
=
vcpus
*
2000
;
}
else
if
(
virStrToLong_ul
(
sched_cpu_shares
,
NULL
,
10
,
&
def
->
cputune
.
shares
)
<
0
)
{
}
else
if
(
virStrToLong_ul
l
(
sched_cpu_shares
,
NULL
,
10
,
&
def
->
cputune
.
shares
)
<
0
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Expecting VMX entry 'sched.cpu.shares' to be an "
"unsigned integer or 'low', 'normal' or 'high' but "
...
...
@@ -3251,7 +3251,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
}
else
if
(
def
->
cputune
.
shares
==
vcpus
*
2000
)
{
virBufferAddLit
(
&
buffer
,
"sched.cpu.shares =
\"
high
\"\n
"
);
}
else
{
virBufferAsprintf
(
&
buffer
,
"sched.cpu.shares =
\"
%lu
\"\n
"
,
virBufferAsprintf
(
&
buffer
,
"sched.cpu.shares =
\"
%l
l
u
\"\n
"
,
def
->
cputune
.
shares
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录