mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
44f82ec276
commit
2f6ff0da5b
@ -11114,6 +11114,8 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
**retstats = *stats;
|
||||||
|
|
||||||
if (blockdev) {
|
if (blockdev) {
|
||||||
/* capacity are reported only per node-name so we need to transfer them */
|
/* capacity are reported only per node-name so we need to transfer them */
|
||||||
qemuBlockStatsPtr capstats;
|
qemuBlockStatsPtr capstats;
|
||||||
@ -11127,8 +11129,6 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
|||||||
(*retstats)->write_threshold = capstats->write_threshold;
|
(*retstats)->write_threshold = capstats->write_threshold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
**retstats = *stats;
|
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < vm->def->ndisks; i++) {
|
for (i = 0; i < vm->def->ndisks; i++) {
|
||||||
disk = vm->def->disks[i];
|
disk = vm->def->disks[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user