Commit graph

2 commits

Author SHA1 Message Date
480bfb7095 virtio-devices: balloon: add statistics virtqueue support
Implement the virtio balloon statistics virtqueue per the VIRTIO spec,
exposing guest memory statistics through a new /vm.balloon-statistics
API endpoint.

Device layer: add stats virtqueue constants and types, wire up the
stats queue in the balloon handler, implement stats request/response
handlers, and expose a public request_balloon_statistics function.

VMM layer: plumb statistics through device manager, VM, and VMM,
add HTTP and D-Bus API endpoints, add ServiceUnavailable (503) to
api_client, add balloon-statistics subcommand to ch-remote, and add
the endpoint to the OpenAPI spec.

The response includes both guest-reported stats and host-known values
(balloon_actual_bytes, balloon_target_bytes, balloon_total_ram_bytes)
so consumers can understand balloon utilization without querying
/vm.info separately.

Also fixes pre-existing rustfmt issues and adds clippy+rustfmt to the
flake devShell.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:05:19 +00:00
e3372a22f6 build: Switch vhost/vhost-user-backend to dsg fork
Some checks are pending
Cloud Hypervisor Tests (Metrics) / Tests (Metrics) (push) Waiting to run
REUSE Compliance Check / REUSE Compliance Check (push) Waiting to run
Shell scripts check / Check shell scripts (push) Waiting to run
Use vhost 0.15.0 and vhost-user-backend 0.21.0 from
https://git.dsg.is/dsg/vhost.git instead of crates.io.

This required bumping several rust-vmm dependencies to maintain
compatibility with the newer vm-memory 0.17.x and vmm-sys-util 0.15.x
APIs used by the fork:

- kvm-bindings: 0.12.1 → 0.14.0
- kvm-ioctls: 0.22.1 → 0.24.0 (nested_state renamed)
- linux-loader: 0.13.1 → 0.13.2
- vfio-bindings: 0.6.0 → 0.6.1
- vfio-ioctls: 0.5.1 → 0.5.2 (VfioDevice::new takes Arc<dyn VfioOps>)
- vfio_user: 0.1.1 → 0.1.2
- virtio-queue: 0.16.0 → 0.17.0
- vm-memory: 0.16.1 → 0.17.1 (Error split, Bytes trait, VolatileSlice)
- vmm-sys-util: 0.14.0 → 0.15.0 (EventConsumer/EventNotifier API)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:15:59 +00:00