Skip to content

Conversation

@mseri
Copy link
Contributor

@mseri mseri commented Sep 13, 2016

When updating the MTU of a VIF it can happen that the VM domid is still out of sync and consequently the computed device id is wrong.
We can use the correct device value passing it via xenopsd as a field in VIF.stat.

See also:
xapi-project/xcp-idl#131
xapi-project/xenopsd#288

Marcello Seri added 2 commits September 13, 2016 12:51
When updating the MTU of a `VIF` it can happen that the VM `domid` is still out of sync and consequently the computed device id is wrong.
We can use the correct device value passing it via `xenopsd` as a field in `VIF.stat`.

See also xapi-project/xcp-idl#131 and xapi-project/xenopsd#288

Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
let dbg = Context.string_of_task __context in
let mtu = Net.Interface.get_mtu dbg ~name:device in
Db.VIF.set_MTU ~__context ~self:vif ~value:(Int64.of_int mtu)
if Opt.is_none state.device
Copy link
Member

@robhoes robhoes Sep 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more common, and IMO clearer, to use a normal match:

match state.device with
| None -> ...
| Some device -> ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree

Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
@mseri mseri changed the title [CP-18781] Use the correct vif device id in update_MTU or fail [CP-18781] Use the correct vif device id in set_MTU or fail Sep 13, 2016
@robhoes
Copy link
Member

robhoes commented Sep 13, 2016

👍:shipit:

@robhoes robhoes merged commit fe3dacf into xapi-project:master Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants