[PATCH 1/2] conf: Rename VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI

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

 



While the string associated with the enum value is virtio-scsi,
having the string "SCSI" show up twice in the name of the enum
value is unnecessary and needlessly deviates from the by now
well established practice of having

  MODEL_(VIRTIO|VIRTIO_TRANSITIONAL|VIRTIO_NON_TRANSITIONAL)

enum values for VirtIO devices.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/conf/domain_conf.c         | 2 +-
 src/conf/domain_conf.h         | 2 +-
 src/qemu/qemu_command.c        | 2 +-
 src/qemu/qemu_domain.c         | 6 +++---
 src/qemu/qemu_domain_address.c | 6 +++---
 src/qemu/qemu_process.c        | 2 +-
 src/vbox/vbox_common.c         | 2 +-
 src/vz/vz_utils.c              | 4 ++--
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d84cc2d482..0c0e422889 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4938,7 +4938,7 @@ static int
 virDomainControllerDefPostParse(virDomainControllerDefPtr cdev)
 {
     if (cdev->iothread &&
-        cdev->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI &&
+        cdev->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO &&
         cdev->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL &&
         cdev->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index c2dcc87ba1..860014d955 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -754,8 +754,8 @@ typedef enum {
     VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068,
     VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI,
     VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI,
-    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI,
     VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078,
+    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO,
     VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL,
     VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL,
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 853b0932b0..dee564905c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2999,7 +2999,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
     switch ((virDomainControllerType)def->type) {
     case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
         switch ((virDomainControllerModelSCSI) def->model) {
-        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
+        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
             if (qemuBuildVirtioDevStr(&buf, "virtio-scsi", qemuCaps,
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1487268a89..75307327a2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5087,7 +5087,7 @@ static int
 qemuDomainDeviceDefValidateControllerAttributes(const virDomainControllerDef *controller)
 {
     if (!(controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
-          (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI ||
+          (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO ||
            controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL ||
            controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL))) {
         if (controller->queues) {
@@ -5142,7 +5142,7 @@ qemuDomainCheckSCSIControllerModel(virQEMUCapsPtr qemuCaps,
             return false;
         }
         break;
-    case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
+    case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO:
     case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL:
     case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
         if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI)) {
@@ -5259,7 +5259,7 @@ qemuDomainDeviceDefValidateControllerSCSI(const virDomainControllerDef *controll
                                           const virDomainDef *def)
 {
     switch ((virDomainControllerModelSCSI) controller->model) {
-        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
+        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
             if (!qemuDomainCheckSCSIControllerIOThreads(controller, def))
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 4740536d82..05d059582e 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -58,11 +58,11 @@ qemuDomainGetSCSIControllerModel(const virDomainDef *def,
     if (qemuDomainIsPSeries(def))
         return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI;
     else if (ARCH_IS_S390(def->os.arch))
-        return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
+        return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO;
     else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI))
         return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC;
     else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI))
-        return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
+        return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO;
 
     virReportError(VIR_ERR_INTERNAL_ERROR,
                    _("Unable to determine model for SCSI controller idx=%d"),
@@ -647,7 +647,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
             case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT:
                 return 0;
 
-            case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
+            case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO:
             case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
                 return virtioFlags;
 
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 68c670d3f2..99ed47bb2a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5193,7 +5193,7 @@ qemuProcessStartValidateIOThreads(virDomainObjPtr vm,
         virDomainControllerDefPtr cont = vm->def->controllers[i];
 
         if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
-            cont->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI &&
+            cont->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO &&
             cont->iothread > 0 &&
             !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI_IOTHREAD)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 0a27deeaf8..9d68cd7119 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -405,7 +405,7 @@ vboxSetStorageController(virDomainControllerDefPtr controller,
             break;
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
-        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
+        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c
index 13f5deeaa5..7766d341f2 100644
--- a/src/vz/vz_utils.c
+++ b/src/vz/vz_utils.c
@@ -144,7 +144,7 @@ vzInitCaps(unsigned long vzVersion, vzCapabilitiesPtr vzCaps)
         vzCaps->vmDiskFormat = VIR_STORAGE_FILE_QCOW2;
         vzCaps->diskBuses = vz7DiskBuses;
         vzCaps->controllerTypes = vz7ControllerTypes;
-        vzCaps->scsiControllerModel = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
+        vzCaps->scsiControllerModel = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO;
     }
 }
 
@@ -471,7 +471,7 @@ int vzGetDefaultSCSIModel(vzDriverPtr driver,
                           PRL_CLUSTERED_DEVICE_SUBTYPE *scsiModel)
 {
     switch ((int)driver->vzCaps.scsiControllerModel) {
-    case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
+    case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO:
         *scsiModel = PCD_VIRTIO_SCSI;
         break;
     case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC:
-- 
2.20.1

--
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