You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2023/01/04 08:49:13 UTC

[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7045: kvm: get vm disk stats for ceph disks

DaanHoogland commented on code in PR #7045:
URL: https://github.com/apache/cloudstack/pull/7045#discussion_r1061251465


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -4010,8 +4010,14 @@ public List<VmDiskStatsEntry> getVmDiskStat(final Connect conn, final String vmN
                 String diskPath = null;
                 if (path != null) {
                     final String[] token = path.split("/");
-                    if (token.length > 3) {
+                    if (DiskProtocol.RBD.equals(disk.getDiskProtocol())) {
+                        if (token.length > 1) {
+                          diskPath = token[1];
+                        }
+                    } else if (token.length > 3) {
                         diskPath = token[3];
+                    }
+                    if (diskPath != null) {
                         final VmDiskStatsEntry stat = new VmDiskStatsEntry(vmName, diskPath, blockStats.wr_req, blockStats.rd_req, blockStats.wr_bytes, blockStats.rd_bytes);
                         stats.add(stat);
                     }

Review Comment:
   of course this can be an extra method



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org