mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 18:45:53 +00:00
a53de0fc53
The qemu-guest-agent's get-fsinfo cannot reliably report ZFS mounts on some guest configurations (notably Proxmox Backup Server), so VMs that have ZFS-formatted partitions show only their EXT4 root and datastore in the VM Overview FILESYSTEMS card while the much larger ZFS dataset holding the actual backups is missing entirely (Fixes #1438). The unified pulse-agent running inside the same guest already has direct OS-level visibility into every mounted filesystem, including ZFS, and Pulse already knows the link between the host agent and its guest via Host.LinkedVMID / Host.LinkedContainerID (set in findLinkedProxmoxEntity by hostname match). GetState now calls StateSnapshot.MergeLinkedHostDisksIntoGuests after producing the snapshot. For each Host with a linked VM or container, that helper: 1. appends host-agent disks to the guest's Disks slice, deduped by mountpoint (qemu-guest-agent entries take precedence so we don't overwrite per-VM-perspective values), and 2. updates the guest's aggregate Disk.{Total,Used,Free,Usage} to include the newly-added partitions so the row total stays consistent with the partitions visible in the FILESYSTEMS card. The merge runs on a defensive copy of the disks slice to avoid mutating the underlying State slice that GetSnapshot shallow-copies. Tests cover the happy path (PBS-shaped fixture mirroring the issue screenshots), the no-link no-op, container linking, empty-mountpoint filtering, and the slice-isolation invariant.