crosvm/vm_control
Frederick Mayle b488863647 devices: SnapshotReader/Writer abstraction + new snapshot format
Instead of building up one big json value, we pass around a "writer"
object that allows writing out fragments of the snapshot and nested
namespacing. The snapshot fragments can use different serialize formats
if desired, e.g. the RAM snapshot uses a raw binary file.

Snapshot directory contents:

     213 .../bus0/ACPIPMResource-0
     299 .../bus0/cmos-0
       2 .../bus0/i8042-0
     542 .../bus0/pci-config-io-port-0
     234 .../bus0/serial-0
     234 .../bus0/serial-1
     234 .../bus0/serial-2
     235 .../bus0/serial-3
     536 .../bus1/pci-config-mmio-0
    3.5K .../bus1/pcivirtio-balloon-0
    6.1K .../bus1/pcivirtio-block-0
    1.7K .../bus1/pcivirtio-rng-0
     536 .../bus1/pci-virtual-config-mmio-0
     569 .../bus1/PvPanic-0
    5.3K .../irqchip
    8.0G .../mem
      52 .../mem_metadata
    6.5K .../vcpu/vcpu0
    6.6K .../vcpu/vcpu1
    6.5K .../vcpu/vcpu2
    6.5K .../vcpu/vcpu3

For now, the new abstractions are not used in `BusDevice` or any layers
beyond `BusDevice`, so each device is still a monolithic JSON file.

`PciConfigIo::debug_label` was modified so that it can't change at
runtime.

Based on some light testing, this seems to reduce the snapshot time for
a particular ubuntu VM config from 14s to 13s.

BUG=b:268093674

Change-Id: Ic16980629ff9321bee19f56f6e8e50f214492a7d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4739910
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2024-01-16 21:42:29 +00:00
..
src devices: SnapshotReader/Writer abstraction + new snapshot format 2024-01-16 21:42:29 +00:00
Cargo.toml Upgrade gdbstub and gdbstub_arch. 2024-01-04 02:06:22 +00:00