Skip to content

Conversation

taoyongd
Copy link
Contributor

Signed-off-by: Taoyong Ding taoyong.ding@citrix.com

@huizh huizh requested a review from robhoes April 25, 2017 07:27
Copy link
Contributor

@lindig lindig left a comment

Choose a reason for hiding this comment

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

The commit message should include what was changed and not just the error that is presumably fixed by the change. From what I understand, the change re-orders the sync after the network change. Why is that the right thing to do?

ocaml/xapi/nm.ml Outdated
let mtu = Int64.of_int (Net.Interface.get_mtu dbg ~name:bridge) in
Db.PIF.set_MTU ~__context ~self:pif ~value:mtu
with _ ->
debug "could not update MTU field on PIF %s" rc.API.pIF_uuid
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should have a priority higher than debug - at least info and I would argue warning is appropriate.

Copy link
Member

Choose a reason for hiding this comment

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

This line wasn't changed, just re-indented. But yes, let's fix it and make it a warn now that we are here.

Copy link
Member

@robhoes robhoes left a comment

Choose a reason for hiding this comment

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

Just two minor changes.

ocaml/xapi/nm.ml Outdated
(* sync MTU *)
try
let mtu = Int64.of_int (Net.Interface.get_mtu dbg ~name:bridge) in
Db.PIF.set_MTU ~__context ~self:pif ~value:mtu
Copy link
Member

Choose a reason for hiding this comment

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

We can optimise it a little and only do the DB set if the current MTU is different from the one in the DB (rc.API.pIF_MTU). This is more important now that this is executed unconditionally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, better option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Fix when pif-plug is called, the mtu is not sync to xapi db.

Signed-off-by: Taoyong Ding <taoyong.ding@citrix.com>
@robhoes robhoes merged commit 4563373 into xapi-project:master Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants