Re: [PATCH 1/5] vz: report "scsi" bus for disks when nothing was set explixitly

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

 



20-Dec-16 13:20, Nikolay Shirokovskiy пишет:


On 09.12.2016 17:36, Maxim Nestratov wrote:
This is necessary for to show CTs created out of libvirt correctly.

Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
  src/vz/vz_sdk.c | 11 ++++-------
  1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index d5688e1..9976e4c 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -562,18 +562,15 @@ prlsdkGetDiskId(PRL_HANDLE disk, int *bus, char **dst)
          *bus = VIR_DOMAIN_DISK_BUS_IDE;
          *dst = virIndexToDiskName(pos, "hd");
          break;
-    case PMS_SCSI_DEVICE:
-        *bus = VIR_DOMAIN_DISK_BUS_SCSI;
-        *dst = virIndexToDiskName(pos, "sd");
-        break;
      case PMS_SATA_DEVICE:
          *bus = VIR_DOMAIN_DISK_BUS_SATA;
          *dst = virIndexToDiskName(pos, "sd");
          break;
+    case PMS_SCSI_DEVICE:
      default:
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unknown disk bus: %X"), ifType);
-        return -1;
+        *bus = VIR_DOMAIN_DISK_BUS_SCSI;
+        *dst = virIndexToDiskName(pos, "sd");
+        break;
      }
if (NULL == *dst)

So this is special case only for containers and only for special
'undefined' value of bus type (we don't set/report bus type if create
containers with help of virtuozzo tools). I would code the condition exactly as
it is. This patch can turn into scsi unexpected cases.

Nikolay

Actually I agree. Will fix in next version

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