Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.py: Fix logic for determining word size #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vipinparashar
Copy link

Currently function list_eth_names determines arch word size by checking for suffix '_64' in os.uname() arch string. This doesn't work on ppc64le platform as the architecture string is reported as 'ppc64le'. Hence the function when executed on ppc64le machine incorrectly assumes that its running on a 32-bit platform. This results in incorrect interface names being evaluated and finally results in error "ValueError: You must specify a valid interface name." during network portal creation.

This patch changes function list_eth_names to use sys.maxsize value to determine word size of the architecture and ultimately use an appropriate offset value in struct ifconf returned from ioctl call.

Currently list_eth_names() checks architecture width to determine
offset for interface array name lookup. This gets broken for ppc64le
architecture. Changing this logic to use 'sys.maxsize'. This issue
got exposed with 'targetcli' command.

Signed-off-by: Vipin K Parashar <[email protected]>
Signed-off-by: Vaibhav Jain <[email protected]>
@vaibhav92
Copy link

This fixes issue #20 identified on powerpc64_le arch

@vaibhav92
Copy link

An alternative is proposed in #18 that gets rid of function list_eth_names entirely.

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