Skip to content

microvm: plumb virtio-pmem devices through the VM config and the kata sandbox - #2607

Closed
ajaysundar.k (ajaysundark) wants to merge 2 commits into
agent-substrate:mainfrom
ajaysundark:pr1-pmem-plumbing
Closed

ajaysundar.k (ajaysundark) wants to merge 2 commits into
agent-substrate:mainfrom
ajaysundark:pr1-pmem-plumbing

Conversation

@ajaysundark

Copy link
Copy Markdown
Contributor

Two small additions that later changes build on: a PmemConfig entry in the Cloud Hypervisor VmConfig (a virtio-pmem device maps a host file into guest physical memory; with discard_writes the file is opened read-only and mapped private, so every guest on a node shares the host's one copy of its pages), and a Pmem list on CreateSandboxOpts that the kata agent mounts when it creates the sandbox, before any container starts.

The agent mount goes through the virtio-fs storage handler: it is the one handler that mounts its Source as given. The block-device handlers wait for a hotplug uevent and the nvdimm handler accepts only ACPI pmem, whereas a virtio-pmem device is a PCI device present before the agent starts.

No behavior change on its own: nothing in this PR adds a pmem device to a VM yet. Part 1 of 4 of serving container image layers to micro-VMs as EROFS over virtio-pmem with DAX (the design issue is #2440); parts 2 to 4 follow as stacked PRs.

  • Tests pass (go test -race ./cmd/ateom-microvm/..., hack/verify-all.sh Go checks)
  • Appropriate changes to documentation are included in the PR (doc comments; no user-facing docs change)

Add PMEMConfig and the Pmem field on VmConfig so ateom can attach host
files to the guest as virtio-pmem devices with discard_writes for DAX
mounts.
…box storages

Extend CreateSandboxOpts with PMEM mounts so the agent mounts virtio-pmem
devices during sandbox creation before containers start. Pass them using
the virtio-fs storage driver, which calls mount(2) directly on Source
without waiting for block hotplug uevents or ACPI NFIT devices.
@ajaysundark

Copy link
Copy Markdown
Contributor Author

This is redundant now that #2218 is merged

@ajaysundark

Copy link
Copy Markdown
Contributor Author

/close

@ajaysundark

Copy link
Copy Markdown
Contributor Author

Closing: #2218 landed the PmemConfig / VmConfig.Pmem half (the guest image now boots over virtio-pmem), and the agent-side pmem sandbox mounts moved into #2610, the only consumer.

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