提交 2f6ff0da 编写于 作者: P Peter Krempa

qemu: Don't overwrite stats in qemuDomainBlocksStatsGather

The size/capacity stats gathered in qemuDomainBlocksStatsGather when
using -blockdev would be overwritten by assigning/copying the transfered
data statistics at the end. Fix it by moving the assignment prior to
fetching the capacity data.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 44f82ec2
......@@ -11114,6 +11114,8 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
goto cleanup;
}
**retstats = *stats;
if (blockdev) {
/* capacity are reported only per node-name so we need to transfer them */
qemuBlockStatsPtr capstats;
......@@ -11127,8 +11129,6 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
(*retstats)->write_threshold = capstats->write_threshold;
}
}
**retstats = *stats;
} else {
for (i = 0; i < vm->def->ndisks; i++) {
disk = vm->def->disks[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册