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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to