Skip to content

host: implement VirtualizationWithContext for AIX (WPAR/LPAR)#2042

Open
Dylan-M wants to merge 3 commits intoshirou:masterfrom
Dylan-M:dylanmyers/host-1c-virtualization
Open

host: implement VirtualizationWithContext for AIX (WPAR/LPAR)#2042
Dylan-M wants to merge 3 commits intoshirou:masterfrom
Dylan-M:dylanmyers/host-1c-virtualization

Conversation

@Dylan-M
Copy link
Copy Markdown
Contributor

@Dylan-M Dylan-M commented Mar 21, 2026

⚠️ Review order: This PR depends on #2040 being merged first. See #2072 for the full review order.

Summary

Replaces the ErrNotImplementedError stub for VirtualizationWithContext on AIX with a real implementation that detects:

  1. WPAR (Workload Partition): Checks uname -W. Returns ("wpar", "guest") if the WPAR ID is non-zero.
  2. LPAR (Logical Partition via PowerVM): Checks uname -L. Returns ("powervm", "guest") if the LPAR name is not "NULL".
  3. Bare metal: Returns ("", "") if neither virtualization layer is detected.

Includes unit tests covering LPAR, WPAR, bare metal, and live system scenarios.

Note: This PR depends on #2040 being merged first.

Only affects AIX — no cross-platform changes.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements AIX-specific virtualization detection in host.VirtualizationWithContext, enabling the host package to report WPAR/LPAR guest environments instead of returning ErrNotImplementedError.

Changes:

  • Add AIX VirtualizationWithContext implementation detecting WPAR (uname -W) and PowerVM LPAR (uname -L), otherwise returning empty values.
  • Introduce AIX command invoker dependency injection (testInvoker/getInvoker) and update AIX host functions to use it.
  • Add/expand AIX unit tests, including virtualization scenarios and additional host function parsing behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
host/host_aix.go Implements AIX virtualization detection and routes command execution through an injectable invoker; adds who parsing + timestamp helper for Users.
host/host_aix_test.go Adds mock invoker and unit tests for virtualization (LPAR/WPAR/bare metal) and other AIX host functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread host/host_aix.go Outdated
Comment thread host/host_aix.go
Comment thread host/host_aix.go
Comment thread host/host_aix.go Outdated
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1c-virtualization branch 4 times, most recently from 5ca1903 to af4a9c0 Compare March 27, 2026 16:26
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1c-virtualization branch from af4a9c0 to b264455 Compare March 30, 2026 16:44
@Dylan-M Dylan-M force-pushed the dylanmyers/host-1c-virtualization branch from b264455 to 30624b8 Compare April 9, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants