Skip to content

Conversation

@changlei-li
Copy link
Contributor

  1. Unify the behaviour when converting interface name to bridge name. Get a stricter check for eth with sscanf or re rather than start_with "eth".
  2. Construct the default name_label for new created network only with position.

Get a stricter check for eth<N> with sscanf or re rather than
start_with "eth"

Signed-off-by: Changlei Li <[email protected]>
Do not use the device name in the new created network name_label
if the device has a position. Given the fact that device names
may be different on different hosts of the pool, even they are of
the same position. So it is more proper to just use the position
in the network name_label.
Also this will be good for interface name change scenario as this
change will not reflect in this default network name_label.

Signed-off-by: Changlei Li <[email protected]>
Copy link
Contributor Author

@changlei-li changlei-li left a comment

Choose a reason for hiding this comment

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

The first commit is a follow of comment under PR #6544

(fun x -> if x.name = device then Some x.position else None)
order
| None ->
get_index_from_ethx 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.

The logic change here is:
If interface_order is None, we are using interface-rename to sort interfaces and rename them to eth. But we can also get the position by parse the name eth.
If interface_order isn't None, we are using networkd to sort interfaces. Position can be gotten in the order.
Then we can simplify the logic of bridge_naming_convention.

@changlei-li changlei-li merged commit 57ab83f into xapi-project:feature/host-network-device-ordering Jun 27, 2025
16 checks passed
@changlei-li changlei-li deleted the private/changleli/CP-308450 branch June 30, 2025 08:51
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