Martin Sivák has posted comments on this change.

Change subject: core: Push ioTune QoS info when hotplugging disk
......................................................................


Patch Set 3:

(4 comments)

http://gerrit.ovirt.org/#/c/33907/3/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugDiskVDSCommand.java:

Line 69:             drive.put(VdsProperties.PropagateErrors, 
disk.getPropagateErrors().toString().toLowerCase());
Line 70: 
Line 71:             // maps to avoid fetching qos object for same disk profile 
id
Line 72:             Map<Guid, Guid> diskProfileStorageQosMap = new HashMap<>();
Line 73:             Map<Guid, Map<String, Long>> storageQosIoTuneMap = new 
HashMap<>();
> I'm not talking about any optimisation here. just plain code readability
Although I consider variable names to have beneficial effect on the code 
readability (even when they are not used as they clearly demonstrate what goes 
to method arguments), I removed them together with the comment.
Line 74:             Map<String, Long> ioTune =
Line 75:                     VmInfoBuilder.buildIoTune(diskImage, 
diskProfileStorageQosMap, storageQosIoTuneMap);
Line 76:             if (ioTune != null) {
Line 77:                 if (vmDevice.getSpecParams() == null) {


Line 72:             Map<Guid, Guid> diskProfileStorageQosMap = new HashMap<>();
Line 73:             Map<Guid, Map<String, Long>> storageQosIoTuneMap = new 
HashMap<>();
Line 74:             Map<String, Long> ioTune =
Line 75:                     VmInfoBuilder.buildIoTune(diskImage, 
diskProfileStorageQosMap, storageQosIoTuneMap);
Line 76:             if (ioTune != null) {
> I didn't mean specparams but rather the static buildioTune
OK, I moved the specParams ioTune logic to separate method that can be shared 
with VmInfoBuilder.

Tests and further refactoring are not part of the intended change here. I am 
only trying to use existing code from one more place.
Line 77:                 if (vmDevice.getSpecParams() == null) {
Line 78:                     vmDevice.setSpecParams(new HashMap<String, 
Object>());
Line 79:                 }
Line 80:                 vmDevice.getSpecParams().put(VdsProperties.Iotune, 
ioTune);


http://gerrit.ovirt.org/#/c/33907/3/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java:

Line 361: 
Line 362:         ArchStrategyFactory.getStrategy(vm.getClusterArch()).run(new 
CreateAdditionalControllers(devices));
Line 363:     }
Line 364: 
Line 365:     static Map<String, Long> buildIoTune(DiskImage diskImage,
> don't think that was the meaning and anyhow I'm against that method here. t
I am not doing such refactoring as part of a patch that should make sure we 
call this even during hotplug. Also the rest of this file does it this way for 
many other fields.. - see addProfileDataToNic, addPortMirroringToVmInterface, 
addQosForDevice, addCustomPropertiesForDevice and others...
Line 366:             Map<Guid, Guid> diskProfileStorageQosMap,
Line 367:             Map<Guid, Map<String, Long>> storageQosIoTuneMap) {
Line 368:         Guid diskProfileId = diskImage.getDiskProfileId();
Line 369:         if (diskProfileId == null) {


Line 387:         }
Line 388:         return null;
Line 389:     }
Line 390: 
Line 391:     static private Map<String, Long> buildIoTuneMap(StorageQos 
storageQos) {
> yes private then static.
It is as a matter of fact :) Java does not care.
Line 392:         // build map
Line 393:         Map<String, Long> ioTuneMap = new HashMap<>();
Line 394:         if (storageQos.getMaxThroughput() != null) {
Line 395:             // Convert MiB/s to B/s vdsm is expecting


-- 
To view, visit http://gerrit.ovirt.org/33907
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4bb85cd307089088be77cff28adbc783ebcaedd
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tomer Saban <tsa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to