Skip to content

Wire up vsock device to propolis-server#1075

Draft
papertigers wants to merge 2 commits intomasterfrom
spr/papertigers/wire-up-vsock-device-to-propolis-server
Draft

Wire up vsock device to propolis-server#1075
papertigers wants to merge 2 commits intomasterfrom
spr/papertigers/wire-up-vsock-device-to-propolis-server

Conversation

@papertigers
Copy link
Contributor

@papertigers papertigers commented Mar 9, 2026

This is the plumbing to allow virtio-socket devices to be usable in propolis-server.

Fixes: #1069

Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
use propolis::vsock::proxy::VsockPortMapping;

// Port 8008 - VM Attestation RFD 605
const ATTESTATION_PORT: u16 = 8008;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to decide on a port!

// TODO (PullRequest): Update these values to what omicron will
// use.
guest_cid: 16,
pci_path: PciPath::new(0, 0x19, 0).unwrap(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be passed by omicron, but we should make this match whatever we pick there.

return Err(SpecBuilderError::VsockInUse);
}

// TODO validate guest_cid does not have reserved bits set
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decide if we should return a SpecBuilderError or a MachineInitError

@papertigers
Copy link
Contributor Author

Paired with @iximeow over a meet to discuss some of this PR.

Key takeaways:

  • provide configuration for propolis-cli PciPath
  • return MachineInitError for guest_cid by adjusting PciVirtioSocket::new to take a u64 and do validation.
  • One phd test is a known issue a phd VM failed to boot? #1035 (comment)
  • The other phd test is expected and okay as it is phd specific at the moment

@iximeow
Copy link
Member

iximeow commented Mar 9, 2026

by adjusting PciVirtioSocket::new to take a u64

the other option is to take a u32 in the API (this struct VirtioSocket) and avoid the risk of taking a cid with bogus upper bits. we'll still want to error for cid={0,1,2} but the API taking the same type as PciVirtioSock::new avoids the conversions (what really stood out to me is that guest_cid as u32 means we'd accept reserved bits in the API and build a device that uses a different truncated CID)

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.

Wire up vsock device to propolis-server

2 participants