Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

TAMPA-LCM: CA-90580: Pass VIF QoS settings to xenopsd. #888

Merged
merged 1 commit into from

3 participants

@johnelse
Owner

Previously we were just passing rate = None, independent of the QoS
settings in xapi.

@johnelse johnelse CA-90580: Pass VIF QoS settings to xenopsd.
Previously we were just passing rate = None, independent of the QoS
settings in xapi.

Signed-off-by: John Else <john.else@citrix.com>
8d04b39
@xen-git
Owner

johnelse/xen-api@8d04b39xapi-project/xen-api@6c55137: Build succeeded. Can merge pull request.

Jira ticket CA-92380

@jonludlam
Owner

@xen-git Approved-lcm

@xen-git
Owner

johnelse/xen-api@8d04b39xapi-project/xen-api@85922e5: Build succeeded. Pull request merged.

@xen-git xen-git merged commit 8d04b39 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2012
  1. @johnelse

    CA-90580: Pass VIF QoS settings to xenopsd.

    johnelse authored
    Previously we were just passing rate = None, independent of the QoS
    settings in xapi.
    
    Signed-off-by: John Else <john.else@citrix.com>
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 1 deletion.
  1. +24 −1 ocaml/xapi/xapi_xenops.ml
View
25 ocaml/xapi/xapi_xenops.ml
@@ -247,6 +247,29 @@ module MD = struct
with _ ->
error "Failed to parse VIF.other_config:mtu; defaulting to network.mtu";
net_mtu in
+ let qos_type = vif.API.vIF_qos_algorithm_type in
+ let qos_params = vif.API.vIF_qos_algorithm_params in
+ let log_qos_failure reason =
+ warn "vif QoS failed: %s (vm=%s,vif=%s)" reason vm.API.vM_uuid vif.API.vIF_uuid in
+ let rate = match qos_type with
+ | "ratelimit" ->
+ let timeslice =
+ try Int64.of_string (List.assoc "timeslice_us" qos_params)
+ with _ -> 0L in
+ begin
+ try
+ let rate = Int64.of_string (List.assoc "kbps" qos_params) in
+ Some (rate, timeslice)
+ with
+ | Failure "int_of_string" ->
+ log_qos_failure "parameter \"kbps\" not an integer"; None
+ | Not_found ->
+ log_qos_failure "necessary parameter \"kbps\" not found"; None
+ | e ->
+ log_qos_failure (Printf.sprintf "unexpected error: %s" (Printexc.to_string e)); None
+ end
+ | "" -> None
+ | _ -> log_qos_failure (Printf.sprintf "unknown type: %s" qos_type); None in
let locking_mode = match vif.API.vIF_locking_mode, net.API.network_default_locking_mode with
| `network_default, `disabled -> Vif.Disabled
| `network_default, `unlocked -> Vif.Unlocked
@@ -275,7 +298,7 @@ module MD = struct
mac = vif.API.vIF_MAC;
carrier = carrier;
mtu = mtu;
- rate = None;
+ rate = rate;
backend = backend_of_network net;
other_config = vif.API.vIF_other_config;
locking_mode = locking_mode;
Something went wrong with that request. Please try again.