Skip to content

Wire up vsock device to propolis-server#1075

Open
papertigers wants to merge 5 commits intomasterfrom
spr/papertigers/wire-up-vsock-device-to-propolis-server
Open

Wire up vsock device to propolis-server#1075
papertigers wants to merge 5 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!

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 picked port 605!

@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)

Created using jj-spr 0.1.0
@papertigers papertigers marked this pull request as ready for review March 16, 2026 21:46
@papertigers papertigers requested a review from iximeow March 16, 2026 21:48
pub struct InvalidGuestCid(u64);

#[derive(Debug, Copy, Clone)]
pub struct GuestCid(u64);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iximeow I ended up creating a type for this and then threading it through everywhere.

Created using jj-spr 0.1.0
@iximeow
Copy link
Member

iximeow commented Mar 16, 2026

(fwiw looks like your test failures are VMs failing to boot which should be sorted as of #1080, if you want to rebase over that)

Created using jj-spr 0.1.0
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