Skip to content

Conversation

robhoes
Copy link
Member

@robhoes robhoes commented Oct 7, 2016

This way we have tighter control over what interfaces are monitored, which are
essentially just PIFs (eth*) and VIFs (vifx.y). Recently, we have had to extend
the blacklist several times, because devices with different names appeared,
which we do not want to monitor.

Signed-off-by: Rob Hoes rob.hoes@citrix.com

This way we have tighter control over what interfaces are monitored, which are
essentially just PIFs (eth*) and VIFs (vifx.y). Recently, we have had to extend
the blacklist several times, because devices with different names appeared,
which we do not want to monitor.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
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.

It's fine. I have a small suggestion but would take it as it is.

let is_monitor_blacklisted = List.exists (fun s -> String.startswith s name) !monitor_blacklist ||
(String.startswith "eth" name && String.contains name '.') in
not is_monitor_blacklisted
List.exists (fun s -> String.startswith s name) !monitor_whitelist
Copy link
Contributor

@lindig lindig Oct 10, 2016

Choose a reason for hiding this comment

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

It is simple enough but I would find creating two predicates even clearer: is_whitelisted and is_vlan and then use List.filter (fun (name,_) -> is_whitelisted name && not (is_vlan name)).

@robhoes robhoes merged commit 55059b3 into xapi-project:master Oct 10, 2016
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.

2 participants