Skip to content

Simplify "cpuinfo" subcommand check #2633

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

Open
wants to merge 1 commit into
base: criu-dev
Choose a base branch
from

Conversation

lianakoleva
Copy link

The command "cpuinfo" requires a subcommand "dump" or "check".

  • CR_CPUINFO is removed; CR_CPUINFO_DUMP and CR_CPUINFO_CHECK are added in its place.
  • All parsing is now done in parse_criu_mode, removing need for passing string subcommand to image_dir_mode.
  • Check for valid subcommand is done once at the start with only the enum CR_CPUINFO_DUMP or CR_CPUINFO_CHECK propagated on success, rather than propagating both CR_CPUINFO and the subcommand string while doing strcmp on each call to image_dir_mode.

The command "cpuinfo" requires a subcommand "dump" or "check".
- `CR_CPUINFO` is removed; `CR_CPUINFO_DUMP` and `CR_CPUINFO_CHECK` are added
  in its place.
- All parsing is now done in `parse_criu_mode`, removing need for passing
  string subcommand to `image_dir_mode`.
- Check for valid subcommand is done once at the start with only the enum
  `CR_CPUINFO_DUMP` or `CR_CPUINFO_CHECK` propagated on success, rather than
  propagating both `CR_CPUINFO` and the subcommand string while doing `strcmp`
  on each call to `image_dir_mode`.

Signed-off-by: Liana Koleva <[email protected]>
@avagin
Copy link
Member

avagin commented Mar 26, 2025

CR_CPUINFO is removed; CR_CPUINFO_DUMP and CR_CPUINFO_CHECK are added in its place.

How does it affect existing users who use CR_CPUINFO?

@lianakoleva
Copy link
Author

@avagin Could you share an example?

@avagin
Copy link
Member

avagin commented Mar 27, 2025

@lianakoleva I think I messed up when I was trying to read this code last time. CR_CPUINFO is a completely internal thing and it isn't a part of our public interface.

Copy link

A friendly reminder that this PR had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants