Skip to content

Commit ca415e7

Browse files
widoRohit Yadav
authored andcommitted
CLOUDSTACK-9929: Do not gather statistics for CDROM or FLOPPY devices
Libvirt / Qemu (KVM) does not collect statistics about these either. On some systems it might even yield a 'internal error' from libvirt when attempting to gather block statistics from such devices. For example Ubuntu 16.04 (Xenial) has a issue with this. Skip them when looping through all devices. Signed-off-by: Wido den Hollander <wido@widodh.nl>
1 parent a97d250 commit ca415e7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,6 +3095,9 @@ public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws Li
30953095
long bytes_rd = 0;
30963096
long bytes_wr = 0;
30973097
for (final DiskDef disk : disks) {
3098+
if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) {
3099+
continue;
3100+
}
30983101
final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
30993102
io_rd += blockStats.rd_req;
31003103
io_wr += blockStats.wr_req;

0 commit comments

Comments
 (0)