You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(pci): separate functions for new and restored types
The code we inherited from Cloud Hypervisor was using a single `new`
method for creating objects both for booted and snapshot resumed VMs.
The `new` method had an optional `state` argument. When this argument
was `Some(state)` the construction of the object happened through
copying values from `state`.
Split this functionality, for various types, in two distinct methods
`new` & `from_state` which are only called for booted and snapshotted
microVMs respectively. This is similar to the pattern we're using
throughout Firecracker, reduces if/else branches, as well as the
arguments of distinct methods.
Signed-off-by: Babis Chalios <[email protected]>
0 commit comments