ofri masad has uploaded a new change for review. Change subject: core: Fix the Network QoS unit translation ......................................................................
core: Fix the Network QoS unit translation engine is using Megabits as units for the Network QoS 'Average' and 'Peak' properties. vdsm is using Kilobytes for those properties. current translation is wrong (1:1024). it should be 1:128 Change-Id: Ib299bc401aa9863717a663666d19ba1ae4ef3aba Bug-Url: https://bugzilla.redhat.com/999799 Signed-off-by: Ofri Masad <oma...@redhat.com> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/18398/1 diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java index 8731e43..693d03c 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java @@ -44,7 +44,8 @@ private static final String USB_BUS = "usb"; private final static String FIRST_MASTER_MODEL = "ich9-ehci1"; private static final String CLOUD_INIT_VOL_ID = "config-2"; - private static final int TO_KILOBITS = 1024; + private static final int MEGABITS_TO_KILOBYTES = 1024/8; + private static final int MEGABYTES_TO_KILOBYTES = 1024; private final List<Map<String, Object>> devices = new ArrayList<Map<String, Object>>(); private List<VmDevice> managedDevices = null; @@ -590,9 +591,9 @@ private static void addQosData(Map<String, Object> specParams, String containerName, int average, int peak, int burst){ if (average > 0) { Map<String, String> qosData = new HashMap<>(); - qosData.put(VdsProperties.QOS_AVERAGE, String.valueOf(average * TO_KILOBITS)); - qosData.put(VdsProperties.QOS_PEAK, String.valueOf(peak * TO_KILOBITS)); - qosData.put(VdsProperties.QOS_BURST, String.valueOf(burst * TO_KILOBITS)); + qosData.put(VdsProperties.QOS_AVERAGE, String.valueOf(average * MEGABITS_TO_KILOBYTES)); + qosData.put(VdsProperties.QOS_PEAK, String.valueOf(peak * MEGABITS_TO_KILOBYTES)); + qosData.put(VdsProperties.QOS_BURST, String.valueOf(burst * MEGABYTES_TO_KILOBYTES)); specParams.put(containerName, qosData); } } -- To view, visit http://gerrit.ovirt.org/18398 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib299bc401aa9863717a663666d19ba1ae4ef3aba Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: ofri masad <oma...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches