Standardize sev snp policy#4446
Conversation
WalkthroughConfiguration files switch numeric SEV/SNP policy literals from decimal to hexadecimal and consolidate per-variant SNP policy settings ( Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
with avocado-framework/avocado-vt#4329 |
4fb9f0a to
cab3bd5
Compare
Change SEV policy values from decimal to hexadecimal format (0x prefix) to align with QEMU and libvirt documentation standards. Changes: - sev_basic_config.cfg: 3/4/6/7 → 0x3/0x4/0x6/0x7 - sev_dhcert_boot.cfg: 7 → 0x7 - sev_hotplug_mem.cfg: 7 → 0x7 This standardization improves consistency across all AMD SEV technology variants and matches official documentation examples. Signed-off-by: Yihuang Yu <yihyu@redhat.com>
Standardize SNP policy configuration to use vm_sev_policy parameter, providing consistent configuration across all AMD SEV technology variants (SEV → SEV-ES → SEV-SNP). Changes: - Replace vm_secure_guest_object_options with vm_sev_policy - Remove intermediate snp_policy variable - Use params.get_numeric() for cleaner code - Align with avocado-vt framework design Reference: avocado-framework/avocado-vt#4329 Signed-off-by: Yihuang Yu <yihyu@redhat.com>
cab3bd5 to
0c9f727
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
qemu/tests/snp_basic_config.py (1)
70-70: Use a hex literal for default SNP policy for consistency.At Line 70, consider replacing
196608with0x30000to match the policy-format standardization goal and improve readability.Proposed consistency tweak
- vm_policy_int = vm.params.get_numeric("vm_sev_policy", 196608) + vm_policy_int = vm.params.get_numeric("vm_sev_policy", 0x30000)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@qemu/tests/snp_basic_config.py` at line 70, Replace the decimal default literal 196608 used in the vm.params.get_numeric call with a hex literal to improve readability and consistency; update the call vm.params.get_numeric("vm_sev_policy", 196608) to use 0x30000 as the default for vm_policy_int (referencing vm_policy_int, vm.params.get_numeric, and "vm_sev_policy").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@qemu/tests/snp_basic_config.py`:
- Line 70: Replace the decimal default literal 196608 used in the
vm.params.get_numeric call with a hex literal to improve readability and
consistency; update the call vm.params.get_numeric("vm_sev_policy", 196608) to
use 0x30000 as the default for vm_policy_int (referencing vm_policy_int,
vm.params.get_numeric, and "vm_sev_policy").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 37fb7463-be2f-4a99-a67f-1e57aa5aa4c1
📒 Files selected for processing (7)
qemu/tests/cfg/sev_basic_config.cfgqemu/tests/cfg/sev_dhcert_boot.cfgqemu/tests/cfg/sev_hotplug_mem.cfgqemu/tests/cfg/snp_attestation.cfgqemu/tests/cfg/snp_basic_config.cfgqemu/tests/sev_basic_config.pyqemu/tests/snp_basic_config.py
✅ Files skipped from review due to trivial changes (4)
- qemu/tests/cfg/sev_dhcert_boot.cfg
- qemu/tests/cfg/sev_basic_config.cfg
- qemu/tests/sev_basic_config.py
- qemu/tests/cfg/sev_hotplug_mem.cfg
🚧 Files skipped from review as they are similar to previous changes (2)
- qemu/tests/cfg/snp_attestation.cfg
- qemu/tests/cfg/snp_basic_config.cfg
Standardize SNP policy configuration to use vm_sev_policy parameter, providing consistent configuration across all AMD SEV technology variants (SEV → SEV-ES → SEV-SNP). And also Change SEV policy values from decimal to hexadecimal format to align with QEMU and libvirt documentation standards.
ID: 5134
Summary by CodeRabbit
Refactor
Bug Fix