Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
26d67015
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看板
提交
26d67015
编写于
7月 18, 2014
作者:
C
Cédric Bosdonnat
提交者:
Gao feng
7月 23, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lxc domain from xml: convert lxc.cap.drop
上级
47e5b5ae
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
61 addition
and
0 deletion
+61
-0
src/lxc/lxc_native.c
src/lxc/lxc_native.c
+25
-0
tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml
tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml
+2
-0
tests/lxcconf2xmldata/lxcconf2xml-cpusettune.xml
tests/lxcconf2xmldata/lxcconf2xml-cpusettune.xml
+2
-0
tests/lxcconf2xmldata/lxcconf2xml-cputune.xml
tests/lxcconf2xmldata/lxcconf2xml-cputune.xml
+2
-0
tests/lxcconf2xmldata/lxcconf2xml-idmap.xml
tests/lxcconf2xmldata/lxcconf2xml-idmap.xml
+2
-0
tests/lxcconf2xmldata/lxcconf2xml-macvlannetwork.xml
tests/lxcconf2xmldata/lxcconf2xml-macvlannetwork.xml
+4
-0
tests/lxcconf2xmldata/lxcconf2xml-memtune.xml
tests/lxcconf2xmldata/lxcconf2xml-memtune.xml
+2
-0
tests/lxcconf2xmldata/lxcconf2xml-nonenetwork.xml
tests/lxcconf2xmldata/lxcconf2xml-nonenetwork.xml
+4
-0
tests/lxcconf2xmldata/lxcconf2xml-nonetwork.xml
tests/lxcconf2xmldata/lxcconf2xml-nonetwork.xml
+2
-0
tests/lxcconf2xmldata/lxcconf2xml-physnetwork.xml
tests/lxcconf2xmldata/lxcconf2xml-physnetwork.xml
+4
-0
tests/lxcconf2xmldata/lxcconf2xml-simple.xml
tests/lxcconf2xmldata/lxcconf2xml-simple.xml
+8
-0
tests/lxcconf2xmldata/lxcconf2xml-vlannetwork.xml
tests/lxcconf2xmldata/lxcconf2xml-vlannetwork.xml
+4
-0
未找到文件。
src/lxc/lxc_native.c
浏览文件 @
26d67015
...
...
@@ -853,6 +853,28 @@ lxcSetBlkioTune(virDomainDefPtr def, virConfPtr properties)
return
0
;
}
static
void
lxcSetCapDrop
(
virDomainDefPtr
def
,
virConfPtr
properties
)
{
virConfValuePtr
value
;
char
**
toDrop
=
NULL
;
const
char
*
capString
;
size_t
i
;
if
((
value
=
virConfGetValue
(
properties
,
"lxc.cap.drop"
))
&&
value
->
str
)
toDrop
=
virStringSplit
(
value
->
str
,
" "
,
0
);
for
(
i
=
0
;
i
<
VIR_DOMAIN_CAPS_FEATURE_LAST
;
i
++
)
{
capString
=
virDomainCapsFeatureTypeToString
(
i
);
if
(
toDrop
!=
NULL
&&
virStringArrayHasString
(
toDrop
,
capString
))
def
->
caps_features
[
i
]
=
VIR_DOMAIN_FEATURE_STATE_OFF
;
}
def
->
features
[
VIR_DOMAIN_FEATURE_CAPABILITIES
]
=
VIR_DOMAIN_CAPABILITIES_POLICY_ALLOW
;
virStringFreeList
(
toDrop
);
}
virDomainDefPtr
lxcParseConfigString
(
const
char
*
config
)
{
...
...
@@ -950,6 +972,9 @@ lxcParseConfigString(const char *config)
if
(
lxcSetBlkioTune
(
vmdef
,
properties
)
<
0
)
goto
error
;
/* lxc.cap.drop */
lxcSetCapDrop
(
vmdef
,
properties
);
goto
cleanup
;
error:
...
...
tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml
浏览文件 @
26d67015
...
...
@@ -25,6 +25,8 @@
</os>
<features>
<privnet/>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
tests/lxcconf2xmldata/lxcconf2xml-cpusettune.xml
浏览文件 @
26d67015
...
...
@@ -13,6 +13,8 @@
</os>
<features>
<privnet/>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
tests/lxcconf2xmldata/lxcconf2xml-cputune.xml
浏览文件 @
26d67015
...
...
@@ -15,6 +15,8 @@
</os>
<features>
<privnet/>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
tests/lxcconf2xmldata/lxcconf2xml-idmap.xml
浏览文件 @
26d67015
...
...
@@ -14,6 +14,8 @@
</idmap>
<features>
<privnet/>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
tests/lxcconf2xmldata/lxcconf2xml-macvlannetwork.xml
浏览文件 @
26d67015
...
...
@@ -8,6 +8,10 @@
<type>
exe
</type>
<init>
/sbin/init
</init>
</os>
<features>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
...
...
tests/lxcconf2xmldata/lxcconf2xml-memtune.xml
浏览文件 @
26d67015
...
...
@@ -15,6 +15,8 @@
</os>
<features>
<privnet/>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
tests/lxcconf2xmldata/lxcconf2xml-nonenetwork.xml
浏览文件 @
26d67015
...
...
@@ -8,6 +8,10 @@
<type>
exe
</type>
<init>
/sbin/init
</init>
</os>
<features>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
...
...
tests/lxcconf2xmldata/lxcconf2xml-nonetwork.xml
浏览文件 @
26d67015
...
...
@@ -10,6 +10,8 @@
</os>
<features>
<privnet/>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
tests/lxcconf2xmldata/lxcconf2xml-physnetwork.xml
浏览文件 @
26d67015
...
...
@@ -8,6 +8,10 @@
<type>
exe
</type>
<init>
/sbin/init
</init>
</os>
<features>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
...
...
tests/lxcconf2xmldata/lxcconf2xml-simple.xml
浏览文件 @
26d67015
...
...
@@ -8,6 +8,14 @@
<type
arch=
'i686'
>
exe
</type>
<init>
/sbin/init
</init>
</os>
<features>
<capabilities
policy=
'allow'
>
<mac_admin
state=
'off'
/>
<mac_override
state=
'off'
/>
<mknod
state=
'off'
/>
<sys_module
state=
'off'
/>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
...
...
tests/lxcconf2xmldata/lxcconf2xml-vlannetwork.xml
浏览文件 @
26d67015
...
...
@@ -8,6 +8,10 @@
<type>
exe
</type>
<init>
/sbin/init
</init>
</os>
<features>
<capabilities
policy=
'allow'
>
</capabilities>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录