Skip to content

xe-reset-networking: Allow the user to perform a network reset without renaming the management interface#6852

Open
sgerag wants to merge 1 commit intoxapi-project:masterfrom
xcp-ng:dev/stefanos/network-mgmt-iface
Open

xe-reset-networking: Allow the user to perform a network reset without renaming the management interface#6852
sgerag wants to merge 1 commit intoxapi-project:masterfrom
xcp-ng:dev/stefanos/network-mgmt-iface

Conversation

@sgerag
Copy link

@sgerag sgerag commented Jan 21, 2026

There are some use cases according to which the user would like to perform a network reconfiguration of the management interface by keeping the interface's name intact. This commit allows the user to run the xe-reset-networking script by requesting the aforementioned behavior.

@sgerag sgerag marked this pull request as ready for review January 22, 2026 17:24
@sgerag sgerag force-pushed the dev/stefanos/network-mgmt-iface branch from c9dfa97 to 693cee0 Compare January 27, 2026 14:06
@sgerag sgerag force-pushed the dev/stefanos/network-mgmt-iface branch from fee2270 to 4d92f24 Compare January 29, 2026 15:19
if not options.reset_interface_name_rules:
configuration.append("Rename interface rules: Yes")
else:
configuration.append("Rename interface rules: No")
Copy link
Contributor

@changlei-li changlei-li Jan 30, 2026

Choose a reason for hiding this comment

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

Suggested change
configuration.append("Rename interface rules: No")
if options.reset_interface_name_rules:
configuration.append("Reset interface name rules: Yes")
else:
configuration.append("Reset interface name rules: No")

I prefer Reset interface name rules against Rename interface rules. I don't quite understand the current one.
At last, please squash the commits into one.

Copy link
Author

Choose a reason for hiding this comment

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

Oops, I missed the logic in the confirmation message. I will fix it. Also, I will update your suggestion in the confirmation message. Although, it won't align correctly with the previous/next parameters printouts.

On a more fundamental note, I realized that by making --reset-interface-name-rules to default to True, essentially there is no way to let the user to avoid this behavior. So, either we will fall back to a parameter that defaults to False or we can have a parameter that has an additional argument passed to denote if the reset will take place or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

--reset-interface-name-rules default with True is same with your initial --keep-interface-name default with False. I don't think it's different with your initial version.

Sorry, I’m getting a little tired of this review... I think I have already clarified the case.

Copy link
Author

@sgerag sgerag Feb 2, 2026

Choose a reason for hiding this comment

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

--reset-interface-name-rules default with True is same with your initial --keep-interface-name default with False. I don't think it's different with your initial version.

No, it is not the same. With --reset-interface-name-rules both the default behavior and when the user passes --reset-interface-name-rules, results in the reset operation. There is no way for the user to request NOT to reset (e.g. --reset-interface-name-rules=false does not work). With --keep-interface-name this is not the case.

Sorry, I’m getting a little tired of this review... I think I have already clarified the case.

No worries, just let me know how (or if) you want to proceed.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, my bad. const=True will ignore =false. Go ahead use keep-interface-name-rules or sth that supports accepting false value. I'm fine.

Copy link
Author

Choose a reason for hiding this comment

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

Done, pushed 2nd time to update the variable name as well.

@sgerag sgerag force-pushed the dev/stefanos/network-mgmt-iface branch from 4d92f24 to d7d54e6 Compare February 2, 2026 09:44
renaming the interface

There are some use cases according to which the user would like to
perform a network reset by keeping the interface's name intact (prevent
reseting the interface name rules). This commit allows the user to run
the xe-reset-networking script by requesting the aforementioned
behavior.

Signed-off-by: Stefanos Gerangelos <stefanos.gerangelos@vates.tech>
@sgerag sgerag force-pushed the dev/stefanos/network-mgmt-iface branch from d7d54e6 to af03630 Compare February 2, 2026 09:47
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.

4 participants