Skip to content

Support PCI resource-mapping passthrough (hostpci mapping=)#15

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/hostpci-mapping
Jun 12, 2026
Merged

Support PCI resource-mapping passthrough (hostpci mapping=)#15
ChrisonSimtian merged 1 commit into
mainfrom
feat/hostpci-mapping

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Why

Proxmox refuses raw PCI passthrough from API tokens:

only root can set 'hostpci0' config for non-mapped devices (HTTP 500)

The token-compatible (and node-portable) way is a PCI resource mapping: an admin maps the device once, then any token with Mapping.Use can attach it as hostpciN: mapping=<name>.

What

  • QemuHostPci now accepts either Mapping (preferred, token-settable) or Host (raw, root-only); the encoder emits mapping=<name> or the raw address.
  • Tests for the mapping form + the both-missing error (suite 35, green).

Verified live (Homelab #115, Phase C)

Created an AMD_Radeon_RX6600 mapping (0000:09:00) and attached it to VM 1003 via the token: hostpci0=mapping=AMD_Radeon_RX6600,pcie=1,x-vga=1 — succeeded where the raw 0000:09:00 form returned HTTP 500. Re-plan is idempotent (Skip).

🤖 Generated with Claude Code

Proxmox only lets the real root@pam user set a raw hostpciN ("only root can set
'hostpciN' config for non-mapped devices") — API tokens are refused. A *mapped*
device is settable by any token with Mapping.Use, and is node-portable.

QemuHostPci now takes either Mapping (preferred, token-settable) or Host (raw,
root-only); the encoder emits `mapping=<name>` or the raw address accordingly.

Verified live: created an AMD_Radeon_RX6600 mapping and attached it to a VM via
token — `hostpci0=mapping=AMD_Radeon_RX6600,pcie=1,x-vga=1` — where the raw form
returned HTTP 500. Part of Homelab #115 (Phase C).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit 0696cae into main Jun 12, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/hostpci-mapping branch June 12, 2026 13:02
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