Skip to content

[action] [PR:3750] display proper message with proper errno for kvm.#192

Merged
mssonicbld merged 1 commit into
Azure:202412from
mssonicbld:cherry/msft-202412/3750
Jun 23, 2025
Merged

[action] [PR:3750] display proper message with proper errno for kvm.#192
mssonicbld merged 1 commit into
Azure:202412from
mssonicbld:cherry/msft-202412/3750

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

What I did

In KVM, there is no system EEPROM. decode-syseeprom should display the information and return the correct errno (ENODEV).

Currently, on KVM, decode-syseeprom will return OK (0) even if there is no system EEPROM.

How I did it

Check if the platform is kvm, if so, log and return.

How to verify it

root@vlab-01:~# decode-syseeprom
Platform x86_64-kvm_x86_64-r0 does not support EEPROM
root@vlab-01:~# echo $?
19
root@vlab-01:~# python3 -c 'import os, sys; print(os.strerror(int(sys.argv[1])))' 19
No such device

Previous command output (if the output of a command-line utility has changed)

admin@vlab-01:~$ sudo decode-syseeprom -s
Failed to read system EEPROM info
admin@vlab-01:~$ echo $?
0

New command output (if the output of a command-line utility has changed)

<!--
    Please make sure you've read and understood our contributing guidelines:
    https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

    ** Make sure all your commits include a signature generated with `git commit -s` **

    If this is a bug fix, make sure your description includes "closes #xxxx",
    "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
    issue when the PR is merged.

    If you are adding/modifying/removing any command or utility script, please also
    make sure to add/modify/remove any unit tests from the tests
    directory as appropriate.

    If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
    subcommand, or you are adding a new subcommand, please make sure you also
    update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
    your changes.

    Please provide the following information:
-->

#### What I did
In KVM, there is no system EEPROM. decode-syseeprom should display the information and return the correct errno (ENODEV).

Currently, on KVM, decode-syseeprom will return OK (0) even if there is no system EEPROM.

#### How I did it
Check if the platform is kvm, if so, log and return.

#### How to verify it
```
root@vlab-01:~# decode-syseeprom
Platform x86_64-kvm_x86_64-r0 does not support EEPROM
root@vlab-01:~# echo $?
19
root@vlab-01:~# python3 -c 'import os, sys; print(os.strerror(int(sys.argv[1])))' 19
No such device
```

#### Previous command output (if the output of a command-line utility has changed)
```
admin@vlab-01:~$ sudo decode-syseeprom -s
Failed to read system EEPROM info
admin@vlab-01:~$ echo $?
0
```
#### New command output (if the output of a command-line utility has changed)
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-utilities#3750

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 63b6805 into Azure:202412 Jun 23, 2025
4 of 6 checks passed
mssonicbld added a commit that referenced this pull request Jun 24, 2025
```<br>* c052761 - (HEAD -> 202503) Merge branch '202412' of https://github.com/Azure/sonic-utilities.msft into 202503 (2025-06-24) [Sonic Automation]
* 63b6805 - (base/202412) display proper message with proper errno for kvm. (#192) (2025-06-24) [mssonicbld]<br>```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant