libvirt: omit PAE/ACPI/APIC features for s390x domains#313
libvirt: omit PAE/ACPI/APIC features for s390x domains#313ibm-adarsh wants to merge 1 commit intoopenshift:mainfrom
Conversation
newDomainDef() always set x86-oriented features. On s390x, RHEL 9 + QEMU 9 with machine types like s390-ccw-virtio-rhel9.6.0 reject <acpi/> with virError 67 (machine type does not support ACPI), blocking worker Machine creation. Clear the features block for s390 after resolving host arch and machine type in newDomainDefForConnection. Add unit tests (ClearX86Only).
WalkthroughA new helper function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @ibm-adarsh. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/cloud/libvirt/client/domain_test.go (1)
3-20: Consider asserting the emitted XML as well.The test verifies the in-memory state; adding an XML assertion would directly cover the libvirt rejection this PR fixes (
<acpi/>/<features>must be absent).🧪 Proposed test hardening
import ( "runtime" + "strings" "testing" libvirtxml "github.com/libvirt/libvirt-go-xml" ) @@ clearX86OnlyDomainFeaturesForArch(&d) if d.Features != nil { t.Fatalf("s390x: expected Features=nil, got %#v", d.Features) } + xmlOut, err := xmlMarshallIndented(&d) + if err != nil { + t.Fatalf("s390x: failed to marshal domain XML: %v", err) + } + if strings.Contains(xmlOut, "<features") || strings.Contains(xmlOut, "<acpi") { + t.Fatalf("s390x: expected x86-only features to be omitted from XML, got:\n%s", xmlOut) + } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/cloud/libvirt/client/domain_test.go` around lines 3 - 20, Add an assertion that the serialized XML emitted from the domain after calling clearX86OnlyDomainFeaturesForArch does not contain a <features> or <acpi> element: after calling newDomainDef() and clearX86OnlyDomainFeaturesForArch(&d) serialize the domain struct to XML (using the existing libvirtxml types/imports already in the test) and assert the resulting XML string does not contain "<features" or "<acpi" (or that the <features> element is absent), referencing the same symbols newDomainDef, clearX86OnlyDomainFeaturesForArch and d used in the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/cloud/libvirt/client/domain_test.go`:
- Around line 3-20: Add an assertion that the serialized XML emitted from the
domain after calling clearX86OnlyDomainFeaturesForArch does not contain a
<features> or <acpi> element: after calling newDomainDef() and
clearX86OnlyDomainFeaturesForArch(&d) serialize the domain struct to XML (using
the existing libvirtxml types/imports already in the test) and assert the
resulting XML string does not contain "<features" or "<acpi" (or that the
<features> element is absent), referencing the same symbols newDomainDef,
clearX86OnlyDomainFeaturesForArch and d used in the test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 353121cb-54e3-4ed3-ab0d-09d791900e9e
📒 Files selected for processing (2)
pkg/cloud/libvirt/client/domain.gopkg/cloud/libvirt/client/domain_test.go
newDomainDef() always set x86-oriented features. On s390x, RHEL 9 + QEMU 9 with machine types like s390-ccw-virtio-rhel9.6.0 reject with virError 67 (machine type does not support ACPI), blocking worker Machine creation.
Clear the features block for s390 after resolving host arch and machine type in newDomainDefForConnection. Add unit tests (ClearX86Only).
Summary by CodeRabbit
Bug Fixes
Tests