Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5d2b0e6f
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,发现更多精彩内容 >>
提交
5d2b0e6f
编写于
5月 18, 2016
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: driver: Remove unnecessary flag in qemuDomainGetStatsBlock
'abbreviated' was true if 'stats' were NULL
上级
90b9995d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
10 deletion
+5
-10
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+5
-10
未找到文件。
src/qemu/qemu_driver.c
浏览文件 @
5d2b0e6f
...
@@ -19321,7 +19321,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
...
@@ -19321,7 +19321,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
virStorageSourcePtr src,
virStorageSourcePtr src,
size_t block_idx,
size_t block_idx,
unsigned int backing_idx,
unsigned int backing_idx,
bool abbreviated,
virHashTablePtr stats)
virHashTablePtr stats)
{
{
qemuBlockStats *entry;
qemuBlockStats *entry;
...
@@ -19340,7 +19339,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
...
@@ -19340,7 +19339,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, block_idx, "backingIndex",
QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, block_idx, "backingIndex",
backing_idx);
backing_idx);
if (
abbreviated
|| !alias || !(entry = virHashLookup(stats, alias))) {
if (
!stats
|| !alias || !(entry = virHashLookup(stats, alias))) {
if (virStorageSourceIsEmpty(src)) {
if (virStorageSourceIsEmpty(src)) {
ret = 0;
ret = 0;
goto cleanup;
goto cleanup;
...
@@ -19417,15 +19416,12 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
...
@@ -19417,15 +19416,12 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
int rc;
int rc;
virHashTablePtr stats = NULL;
virHashTablePtr stats = NULL;
qemuDomainObjPrivatePtr priv = dom->privateData;
qemuDomainObjPrivatePtr priv = dom->privateData;
bool abbreviated = false;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
int count_index = -1;
int count_index = -1;
size_t visited = 0;
size_t visited = 0;
bool visitBacking = !!(privflags & QEMU_DOMAIN_STATS_BACKING);
bool visitBacking = !!(privflags & QEMU_DOMAIN_STATS_BACKING);
if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) {
if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) {
abbreviated = true; /* it's ok, just go ahead silently */
} else {
qemuDomainObjEnterMonitor(driver, dom);
qemuDomainObjEnterMonitor(driver, dom);
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats,
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats,
visitBacking);
visitBacking);
...
@@ -19435,10 +19431,9 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
...
@@ -19435,10 +19431,9 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
if (qemuDomainObjExitMonitor(driver, dom) < 0)
if (qemuDomainObjExitMonitor(driver, dom) < 0)
goto cleanup;
goto cleanup;
if (rc < 0) {
/* failure to retrieve stats is fine at this point */
if (rc < 0)
virResetLastError();
virResetLastError();
abbreviated = true; /* still ok, again go ahead silently */
}
}
}
/* When listing backing chains, it's easier to fix up the count
/* When listing backing chains, it's easier to fix up the count
...
@@ -19455,7 +19450,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
...
@@ -19455,7 +19450,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
while (src && (backing_idx == 0 || visitBacking)) {
while (src && (backing_idx == 0 || visitBacking)) {
if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxparams,
if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxparams,
disk, src, visited, backing_idx,
disk, src, visited, backing_idx,
abbreviated,
stats) < 0)
stats) < 0)
goto cleanup;
goto cleanup;
visited++;
visited++;
backing_idx++;
backing_idx++;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录