Skip to content

Conversation

@Anushree-Mathur
Copy link
Contributor

@Anushree-Mathur Anushree-Mathur commented Nov 21, 2025

Added a condition to cancel a testcase if machine is ppc64 or ppc64le and cpu_mode is maximum as this mode is not supported for power architecture.

Signed-off-by: Anushree-Mathur [email protected]

Summary by CodeRabbit

  • Tests
    • Tests now automatically cancel on Power (PPC) systems when CPU mode is set to "maximum", stopping execution early (before CPU XML creation) to avoid running unsupported configurations on that hardware.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

This pull request modifies the vcpu_misc.py test file to add a guard condition in the update_cpu_xml function. The modification cancels tests when running on PPC hardware with cpu_mode configured as "maximum", since this configuration is not supported on Power architectures. The guard introduces an early test cancellation path that executes before CPU XML creation logic proceeds.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

  • Single-file change affecting one function
  • Straightforward guard condition for test cancellation
  • No structural or logic modifications beyond the new guard clause
  • Minimal scope and homogeneous nature of change

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a condition to cancel a testcase when maximum CPU mode is not supported for PPC hardware.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28cf924 and 019bd74.

📒 Files selected for processing (1)
  • libvirt/tests/src/cpu/vcpu_misc.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libvirt/tests/src/cpu/vcpu_misc.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Python 3.11
  • GitHub Check: Python 3.9
  • GitHub Check: Python 3.12
  • GitHub Check: Python 3.8

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 875c970 and 28cf924.

📒 Files selected for processing (1)
  • libvirt/tests/src/cpu/vcpu_misc.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.14.5)
libvirt/tests/src/cpu/vcpu_misc.py

96-96: Undefined name platform

(F821)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Python 3.8
  • GitHub Check: Python 3.12
  • GitHub Check: Python 3.11
  • GitHub Check: Python 3.9

Added a condition to cancel a testcase if machine is ppc64 or ppc64le
and cpu_mode is maximum as this mode is not supported for power
architecture.
Signed-off-by: Anushree-Mathur <[email protected]>
@Anushree-Mathur
Copy link
Contributor Author

Before applying the patch:

02:17:22 WARNING : Overriding user setting and enabling kvm bootstrap as guest tests are requested
02:17:22 INFO    : Check for environment
02:17:23 INFO    : Creating temporary mux dir
02:17:23 INFO    :
02:17:23 INFO    : Running Guest Tests Suite cpu_misc_positive
02:17:23 INFO    : Running: /usr/local/bin/avocado run --vt-type libvirt --vt-config /home/Anu/tests/data/avocado-vt/backends/libvirt/cfg/cpu_misc_positive.cfg                 --force-job-id 0860f6aff97cd3ed6229886079df07aee07d36f3                 --job-results-dir /home/Anu/tests/results  --vt-only-filter                                             "virtio_scsi virtio_net qcow2 Fedora.43.ppc64le"
JOB ID     : 0860f6aff97cd3ed6229886079df07aee07d36f3
JOB LOG    : /home/Anu/tests/results/job-2025-11-20T02.17-0860f6a/job.log
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: STARTED
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: PASS (42.76 s)
 (2/3) type_specific.io-github-autotest-libvirt.vcpu_misc.positive_test.mode_max: STARTED
 (2/3) type_specific.io-github-autotest-libvirt.vcpu_misc.positive_test.mode_max: ERROR: Failed to define avocado-vt-vm1 for reason:\nerror: Failed to define domain from /var/tmp/xml_utils_temp_7lpkuheu.xml\nerror: unsupported configuration: maximum CPU is not supported by QEMU binary\n (4.66 s)
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: STARTED
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: PASS (4.14 s)
RESULTS    : PASS 2 | ERROR 1 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

After applying the patch:

06:18:39 WARNING : Overriding user setting and enabling kvm bootstrap as guest tests are requested
06:18:40 INFO    : Check for environment
06:18:41 INFO    : Creating temporary mux dir
06:18:41 INFO    :
06:18:41 INFO    : Running Guest Tests Suite cpu_misc_positive
06:18:41 INFO    : Running: /usr/local/bin/avocado run --vt-type libvirt --vt-config /home/Anu/tests/data/avocado-vt/backends/libvirt/cfg/cpu_misc_positive.cfg                 --force-job-id 649445b837d7128d7e235155d1a64637cfba1f69                 --job-results-dir /home/Anu/tests/results  --vt-only-filter                                             "virtio_scsi virtio_net qcow2 Fedora.43.ppc64le"
JOB ID     : 649445b837d7128d7e235155d1a64637cfba1f69
JOB LOG    : /home/Anu/tests/results/job-2025-11-21T06.18-649445b/job.log
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: STARTED
 (1/3) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: PASS (42.97 s)
 (2/3) type_specific.io-github-autotest-libvirt.vcpu_misc.positive_test.mode_max: STARTED
 (2/3) type_specific.io-github-autotest-libvirt.vcpu_misc.positive_test.mode_max: CANCEL: "maximum" mode is not supported in power arch (4.60 s)
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: STARTED
 (3/3) io-github-autotest-libvirt.remove_guest.without_disk: PASS (4.44 s)
RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 1

@Anushree-Mathur
Copy link
Contributor Author

Here is the command and the output to showcase that this mode is not supported for ppc!

virsh domcapabilities --arch ppc64 --machine pseries | grep -A2 maximum
    <mode name='maximum' supported='no'/>
    <mode name='host-model' supported='yes'>
      <model fallback='allow'>POWER11</model>

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.

1 participant