Skip to content

Persist virtio state and reconstruct console attachments #4439

Description

Tracking issue: MicroVM support and private snapshot restore.

Motivation

Restoring guest RAM alone is insufficient for a virtio device: negotiated state,
queue ownership, pending work, and interrupt state must agree with the guest.
Console support provides a concrete first consumer of a generic persistence
contract and makes buffered I/O and host-endpoint reconstruction observable.

Proposed Scope

  • Define bounded, validated generic virtio device and queue persistence.
  • Defer restored device activation until required state and attachments are ready,
    with an explicit acknowledgment of activation success or failure.
  • Persist the console's buffered I/O under a documented save-boundary contract.
  • Reconstruct host console endpoints rather than serializing process-local handles
    or assuming an endpoint survives capture.
  • Include generic persistence and working console reconstruction in the same PR.
  • Propagate quiesce and activation failures through the snapshot transaction.

Acceptance Criteria

  • Generic state round trips preserve negotiated features, queue state, and
    relevant interrupt/device status; malformed state is rejected without panics.
  • No restored device consumes descriptors or emits I/O before activation is
    acknowledged, and a failed activation unwinds cleanly.
  • Console buffer tests verify the documented handling of bytes pending at the
    save boundary, including empty and partially consumed buffers.
  • A VMM test captures and restores with active console I/O and verifies guest
    progress and the expected byte sequence after endpoint reconstruction.
  • Missing or incompatible host endpoints produce a bounded failure and release
    any resources already prepared.

Dependencies

Non-Goals

Acknowledged activation is a lifecycle requirement. Network and filesystem
persistence are separate consumers of this generic contract.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions