Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
41f1db6a
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看板
提交
41f1db6a
编写于
5月 23, 2012
作者:
G
Guido Günther
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce filesystem limits to virDomainFSDef
上级
b46e0054
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
3 deletion
+55
-3
docs/formatdomain.html.in
docs/formatdomain.html.in
+14
-0
docs/schemas/domaincommon.rng
docs/schemas/domaincommon.rng
+12
-0
src/conf/domain_conf.c
src/conf/domain_conf.c
+27
-3
src/conf/domain_conf.h
src/conf/domain_conf.h
+2
-0
未找到文件。
docs/formatdomain.html.in
浏览文件 @
41f1db6a
...
@@ -1686,6 +1686,20 @@
...
@@ -1686,6 +1686,20 @@
default read-write access is given (currently only works for
default read-write access is given (currently only works for
QEMU/KVM driver).
QEMU/KVM driver).
</dd>
</dd>
<dt><code>
space_hard_limit
</code></dt>
<dd>
Maximum space available to this guest's filesystem.
<span
class=
"since"
>
Since 0.9.13
</span>
</dd>
<dt><code>
space_soft_limit
</code></dt>
<dd>
Maximum space available to this guest's filesystem. The container is
permitted to exceed its soft limits for a grace period of time. Afterwards the
hard limit is enforced.
<span
class=
"since"
>
Since 0.9.13
</span>
</dd>
</dl>
</dl>
<h4><a
name=
"elementsAddress"
>
Device Addresses
</a></h4>
<h4><a
name=
"elementsAddress"
>
Device Addresses
</a></h4>
...
...
docs/schemas/domaincommon.rng
浏览文件 @
41f1db6a
...
@@ -1316,6 +1316,18 @@
...
@@ -1316,6 +1316,18 @@
<ref
name=
"address"
/>
<ref
name=
"address"
/>
</optional>
</optional>
</interleave>
</interleave>
<interleave>
<optional>
<element
name=
"space_hard_limit"
>
<ref
name=
'scaledInteger'
/>
</element>
</optional>
<optional>
<element
name=
"space_soft_limit"
>
<ref
name=
'scaledInteger'
/>
</element>
</optional>
</interleave>
</element>
</element>
</define>
</define>
<!--
<!--
...
...
src/conf/domain_conf.c
浏览文件 @
41f1db6a
...
@@ -4200,9 +4200,10 @@ cleanup:
...
@@ -4200,9 +4200,10 @@ cleanup:
*/
*/
static
virDomainFSDefPtr
static
virDomainFSDefPtr
virDomainFSDefParseXML
(
xmlNodePtr
node
,
virDomainFSDefParseXML
(
xmlNodePtr
node
,
xmlXPathContextPtr
ctxt
,
unsigned
int
flags
)
{
unsigned
int
flags
)
{
virDomainFSDefPtr
def
;
virDomainFSDefPtr
def
;
xmlNodePtr
cur
;
xmlNodePtr
cur
,
save_node
=
ctxt
->
node
;
char
*
type
=
NULL
;
char
*
type
=
NULL
;
char
*
fsdriver
=
NULL
;
char
*
fsdriver
=
NULL
;
char
*
source
=
NULL
;
char
*
source
=
NULL
;
...
@@ -4210,6 +4211,8 @@ virDomainFSDefParseXML(xmlNodePtr node,
...
@@ -4210,6 +4211,8 @@ virDomainFSDefParseXML(xmlNodePtr node,
char
*
accessmode
=
NULL
;
char
*
accessmode
=
NULL
;
char
*
wrpolicy
=
NULL
;
char
*
wrpolicy
=
NULL
;
ctxt
->
node
=
node
;
if
(
VIR_ALLOC
(
def
)
<
0
)
{
if
(
VIR_ALLOC
(
def
)
<
0
)
{
virReportOOMError
();
virReportOOMError
();
return
NULL
;
return
NULL
;
...
@@ -4237,6 +4240,18 @@ virDomainFSDefParseXML(xmlNodePtr node,
...
@@ -4237,6 +4240,18 @@ virDomainFSDefParseXML(xmlNodePtr node,
def
->
accessmode
=
VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH
;
def
->
accessmode
=
VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH
;
}
}
if
(
virDomainParseScaledValue
(
"./space_hard_limit[1]"
,
ctxt
,
&
def
->
space_hard_limit
,
1
,
ULONG_LONG_MAX
,
false
)
<
0
)
goto
error
;
if
(
virDomainParseScaledValue
(
"./space_soft_limit[1]"
,
ctxt
,
&
def
->
space_soft_limit
,
1
,
ULONG_LONG_MAX
,
false
)
<
0
)
goto
error
;
cur
=
node
->
children
;
cur
=
node
->
children
;
while
(
cur
!=
NULL
)
{
while
(
cur
!=
NULL
)
{
if
(
cur
->
type
==
XML_ELEMENT_NODE
)
{
if
(
cur
->
type
==
XML_ELEMENT_NODE
)
{
...
@@ -4303,6 +4318,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
...
@@ -4303,6 +4318,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
goto
error
;
goto
error
;
cleanup:
cleanup:
ctxt
->
node
=
save_node
;
VIR_FREE
(
type
);
VIR_FREE
(
type
);
VIR_FREE
(
fsdriver
);
VIR_FREE
(
fsdriver
);
VIR_FREE
(
target
);
VIR_FREE
(
target
);
...
@@ -7076,7 +7092,7 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
...
@@ -7076,7 +7092,7 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
goto
error
;
goto
error
;
}
else
if
(
xmlStrEqual
(
node
->
name
,
BAD_CAST
"filesystem"
))
{
}
else
if
(
xmlStrEqual
(
node
->
name
,
BAD_CAST
"filesystem"
))
{
dev
->
type
=
VIR_DOMAIN_DEVICE_FS
;
dev
->
type
=
VIR_DOMAIN_DEVICE_FS
;
if
(
!
(
dev
->
data
.
fs
=
virDomainFSDefParseXML
(
node
,
flags
)))
if
(
!
(
dev
->
data
.
fs
=
virDomainFSDefParseXML
(
node
,
ctxt
,
flags
)))
goto
error
;
goto
error
;
}
else
if
(
xmlStrEqual
(
node
->
name
,
BAD_CAST
"interface"
))
{
}
else
if
(
xmlStrEqual
(
node
->
name
,
BAD_CAST
"interface"
))
{
dev
->
type
=
VIR_DOMAIN_DEVICE_NET
;
dev
->
type
=
VIR_DOMAIN_DEVICE_NET
;
...
@@ -8621,7 +8637,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
...
@@ -8621,7 +8637,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
if
(
n
&&
VIR_ALLOC_N
(
def
->
fss
,
n
)
<
0
)
if
(
n
&&
VIR_ALLOC_N
(
def
->
fss
,
n
)
<
0
)
goto
no_memory
;
goto
no_memory
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
virDomainFSDefPtr
fs
=
virDomainFSDefParseXML
(
nodes
[
i
],
virDomainFSDefPtr
fs
=
virDomainFSDefParseXML
(
nodes
[
i
],
ctxt
,
flags
);
flags
);
if
(
!
fs
)
if
(
!
fs
)
goto
error
;
goto
error
;
...
@@ -11319,6 +11335,14 @@ virDomainFSDefFormat(virBufferPtr buf,
...
@@ -11319,6 +11335,14 @@ virDomainFSDefFormat(virBufferPtr buf,
if
(
virDomainDeviceInfoFormat
(
buf
,
&
def
->
info
,
flags
)
<
0
)
if
(
virDomainDeviceInfoFormat
(
buf
,
&
def
->
info
,
flags
)
<
0
)
return
-
1
;
return
-
1
;
if
(
def
->
space_hard_limit
)
virBufferAsprintf
(
buf
,
" <space_hard_limit unit='bytes'>"
"%llu</space_hard_limit>
\n
"
,
def
->
space_hard_limit
);
if
(
def
->
space_soft_limit
)
{
virBufferAsprintf
(
buf
,
" <space_soft_limit unit='bytes'>"
"%llu</space_soft_limit>
\n
"
,
def
->
space_soft_limit
);
}
virBufferAddLit
(
buf
,
" </filesystem>
\n
"
);
virBufferAddLit
(
buf
,
" </filesystem>
\n
"
);
return
0
;
return
0
;
...
...
src/conf/domain_conf.h
浏览文件 @
41f1db6a
...
@@ -699,6 +699,8 @@ struct _virDomainFSDef {
...
@@ -699,6 +699,8 @@ struct _virDomainFSDef {
char
*
dst
;
char
*
dst
;
unsigned
int
readonly
:
1
;
unsigned
int
readonly
:
1
;
virDomainDeviceInfo
info
;
virDomainDeviceInfo
info
;
unsigned
long
long
space_hard_limit
;
/* in bytes */
unsigned
long
long
space_soft_limit
;
/* in bytes */
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录