Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1f80c3eb
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,发现更多精彩内容 >>
提交
1f80c3eb
编写于
9月 05, 2011
作者:
O
Osier Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
latency: Implemente the public API
上级
1c622a3d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
71 addition
and
0 deletion
+71
-0
src/libvirt.c
src/libvirt.c
+71
-0
未找到文件。
src/libvirt.c
浏览文件 @
1f80c3eb
...
...
@@ -6441,6 +6441,77 @@ error:
return
-
1
;
}
/**
* virDomainBlockStatsFlags:
* @dom: pointer to domain object
* @path: path to the block device
* @params: pointer to block stats parameter object
* (return value)
* @nparams: pointer to number of block stats
* @flags: unused, always passes 0
*
* This function is to get block stats parameters for block
* devices attached to the domain.
*
* The @path is the name of the block device. Get this
* by calling virDomainGetXMLDesc and finding the <target dev='...'>
* attribute within //domain/devices/disk. (For example, "xvda").
*
* Domains may have more than one block device. To get stats for
* each you should make multiple calls to this function.
*
* The @params array will be filled with the value equal to the number of
* parameters suggested by @nparams.
*
* As the value of @nparams is dynamic, call the API setting @nparams to 0 and
* @params as NULL, the API returns the number of parameters supported by the
* HV by updating @nparams on SUCCESS. (Note that block device of different type
* might support different parameters numbers, so it might be necessary to compute
* @nparams for each block device type). The caller should then allocate @params
* array, i.e. (sizeof(@virTypedParameter) * @nparams) bytes and call the API
* again. See virDomainGetMemoryParameters for more details.
*
* Returns -1 in case of error, 0 in case of success.
*/
int
virDomainBlockStatsFlags
(
virDomainPtr
dom
,
const
char
*
path
,
virTypedParameterPtr
params
,
int
*
nparams
,
unsigned
int
flags
)
{
virConnectPtr
conn
;
VIR_DOMAIN_DEBUG
(
dom
,
"path=%s, params=%p, nparams=%d, flags=%x"
,
path
,
params
,
nparams
?
*
nparams
:
-
1
,
flags
);
virResetLastError
();
if
(
!
VIR_IS_CONNECTED_DOMAIN
(
dom
))
{
virLibDomainError
(
VIR_ERR_INVALID_DOMAIN
,
__FUNCTION__
);
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
!
path
||
(
nparams
==
NULL
)
||
(
*
nparams
<
0
))
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
conn
=
dom
->
conn
;
if
(
conn
->
driver
->
domainBlockStatsFlags
)
{
int
ret
;
ret
=
conn
->
driver
->
domainBlockStatsFlags
(
dom
,
path
,
params
,
nparams
,
flags
);
if
(
ret
<
0
)
goto
error
;
return
ret
;
}
virLibConnError
(
VIR_ERR_NO_SUPPORT
,
__FUNCTION__
);
error:
virDispatchError
(
dom
->
conn
);
return
-
1
;
}
/**
* virDomainInterfaceStats:
* @dom: pointer to the domain object
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录