Re: [PATCH v2 5/5] vz: get disks statistics for CTs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



22-Dec-16 12:13, Daniel P. Berrange пишет:

On Wed, Dec 21, 2016 at 10:38:52PM +0300, Maxim Nestratov wrote:
A CT disk statistics is reported with prefix "hdd" and we should use
it to extract data.

Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
  src/vz/vz_driver.c | 10 ++++++++--
  src/vz/vz_sdk.c    |  5 +++--
  src/vz/vz_sdk.h    |  2 +-
  3 files changed, 12 insertions(+), 5 deletions(-)
ACK


Regards,
Daniel
Though you ACKed this version I changed it a bit addressing Nickolay's comments on this patch and pushed modified version. The new chunk is as follows:

     address = &disk->info.addr.drive;
-    switch (disk->bus) {
-    case VIR_DOMAIN_DISK_BUS_IDE:
-        prefix = "ide";
-        idx = address->bus * 2 + address->unit;
-        break;
-    case VIR_DOMAIN_DISK_BUS_SATA:
-        prefix = "sata";
-        idx = address->unit;
-        break;
-    case VIR_DOMAIN_DISK_BUS_SCSI:
-        prefix = "scsi";
+
+    if (isCt) {
+        prefix = "hdd";
         idx = address->unit;
-        break;
-    default:
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unknown disk bus: %X"), disk->bus);
-        goto cleanup;
+    } else {
+        switch (disk->bus) {
+        case VIR_DOMAIN_DISK_BUS_IDE:
+            prefix = "ide";
+            idx = address->bus * 2 + address->unit;
+            break;
+        case VIR_DOMAIN_DISK_BUS_SATA:
+            prefix = "sata";
+            idx = address->unit;
+            break;
+        case VIR_DOMAIN_DISK_BUS_SCSI:
+            prefix = "scsi";
+            idx = address->unit;
+            break;
+        default:
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Unknown disk bus: %X"), disk->bus);
+            goto cleanup;
+        }
     }

Thus, although we report CT's disk bus as scsi in most cases, we don't really care what exact bus is and explicitly set prefix to "hdd" to extract statistics.

With this change I pushed the series.

Maxim

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux