+ /* Fetching block info stats only if needed*/
+ if (extra_stats & (ex_stats_disk_allocation | ex_stats_disk_capacity |
+ ex_stats_disk_physical)) {
+ /* Block info statistics can be only fetched from devices with 'source'
+ * defined */
+ if (block_dev->has_source) {
+ if (virDomainGetBlockInfo(block_dev->dom, block_dev->path, &binfo, 0) <
+ 0) {
+ ERROR(PLUGIN_NAME " plugin: virDomainGetBlockInfo failed for path: %s",
+ block_dev->path);
+
+ virErrorPtr err = virGetLastError();
+ if (err->code == VIR_ERR_NO_SUPPORT) {
+
+ if (extra_stats & ex_stats_disk_allocation)
+ ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats "
+ "selector: disk_allocation");
+ if (extra_stats & ex_stats_disk_capacity)
+ ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats "
+ "selector: disk_capacity");
+ if (extra_stats & ex_stats_disk_physical)
+ ERROR(PLUGIN_NAME " plugin: Disabled unsupported ExtraStats "
+ "selector: disk_physical");
+
+ extra_stats &= ~(ex_stats_disk_allocation | ex_stats_disk_capacity |
+ ex_stats_disk_physical);
+ }
+
+ return -1;
+ }
+ }
+ }
+
+ struct lv_block_stats bstats;
+ init_block_stats(&bstats);
+
+ if (lv_domain_block_stats(block_dev->dom, block_dev->path, &bstats) < 0) {
+ ERROR(PLUGIN_NAME " plugin: lv_domain_block_stats failed");