-
Notifications
You must be signed in to change notification settings - Fork 182
Change SNP policy to hex format #4373
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
base: master
Are you sure you want to change the base?
Conversation
(1/3) Host_RHEL.m10.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.1.x86_64.io-github-autotest-qemu.snp_basic_config.policy_default.q35: STARTED |
@zixi-chen @zhencliu could you please help to review? Thanks. |
@JinLiul there's a mistake I made before, I think we can fix this with this patch. For the single socket SNP policy, it should be 0x130000, in binary 100110000000000000000, bit 20 stands for single socket. By the way, policy = 30000 or 0x30000 both of the methods should work. |
@zixi-chen I had that fixed in decimal already in my PR https://github.com/autotest/tp-qemu/pull/4351/files#diff-aa2e3ba229ed25005ee285fbac830a765e8e69bdfef6c16b1cc012d783a7052dR37 |
ffaa726
to
47765e9
Compare
The policy doesn't match if change the 0x30000 to 30000. |
47765e9
to
0811c3d
Compare
Updated the policy_singlesocket to 0x130000 |
Just suggest to change the header of the commit to: So we can easily know which tc/module is modified from the commit I have to remove the LGTM, for avocado-framework/avocado-vt#4212 is to be reviewed, there might be some code update |
Signed-off-by: Jin Liu <[email protected]>
0811c3d
to
714aaf1
Compare
WalkthroughUpdated SNP policy values in a config to hex and adjusted quoting for policy substitution. In test logic, replaced numeric helper with string-based int parsing using base 0 to support hex/decimal. No other logic, structure, or public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. ✨ Finishing touches
🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
qemu/tests/cfg/snp_basic_config.cfg (1)
32-33
: Single-socket policy value is right; minor maintainability nit.0x130000 = 0x100000 (bit20 single-socket) + 0x30000 (base). Consider an inline comment to document the bit meaning.
Example:
- snp_policy = 0x130000 + snp_policy = 0x130000 # bit20 (single-socket) | base 0x30000qemu/tests/snp_basic_config.py (1)
51-55
: Parse robustness and clearer mismatch diagnostics.Guard against missing/invalid params and include both hex/dec in the failure to speed up triage.
Apply:
- vm_policy = int(vm.params.get("snp_policy"), 0) + vm_policy_str = vm.params.get("snp_policy") + if not vm_policy_str: + test.cancel("Missing 'snp_policy' param in test params.") + try: + vm_policy = int(vm_policy_str, 0) + except Exception as e: + test.cancel(f"Invalid snp_policy '{vm_policy_str}': {e}") @@ - if sev_guest_info["snp-policy"] != vm_policy: - test.fail("QMP snp policy doesn't match %s." % vm_policy) + if sev_guest_info["snp-policy"] != vm_policy: + test.fail( + "QMP snp policy mismatch: expected %s (%d), got %s (%d)." % + (hex(vm_policy), vm_policy, hex(sev_guest_info["snp-policy"]), + sev_guest_info["snp-policy"]) + )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
qemu/tests/cfg/snp_basic_config.cfg
(1 hunks)qemu/tests/snp_basic_config.py
(1 hunks)
🔇 Additional comments (2)
qemu/tests/cfg/snp_basic_config.cfg (2)
25-26
: Hex default policy and unquoted object option look correct.0x30000 matches the prior 196608; unquoting policy=${snp_policy} is fine for QEMU option assembly.
28-29
: Debug policy conversion is accurate.0xB0000 equals the previous 720896; no issues anticipated.
Updated the commit title. |
ID: 4377
After applying avocado-framework/avocado-vt#4212 , need to change snp policy to hex format.
Summary by CodeRabbit