@@ -64,6 +64,8 @@ type StartVMResponse struct {
6464
6565const (
6666 testImageName = "ghcr.io/ease-lab/helloworld:var_workload"
67+ fileBackend = "File"
68+ uffdBackend = "Uffd"
6769)
6870
6971// StartVM Boots a VM if it does not exist
@@ -104,7 +106,7 @@ func (o *Orchestrator) StartVMWithEnvironment(ctx context.Context, vmID, imageNa
104106
105107 tStart = time .Now ()
106108 conf := o .getVMConfig (vm )
107- _ , err = o .fcClient .CreateVM (ctx , conf )
109+ resp , err : = o .fcClient .CreateVM (ctx , conf )
108110 startVMMetric .MetricMap [metrics .FcCreateVM ] = metrics .ToUS (time .Since (tStart ))
109111 if err != nil {
110112 return nil , nil , errors .Wrap (err , "failed to create the microVM in firecracker-containerd" )
@@ -214,7 +216,7 @@ func (o *Orchestrator) StartVMWithEnvironment(ctx context.Context, vmID, imageNa
214216 VMMStatePath : o .getSnapshotFile (vmID ),
215217 WorkingSetPath : o .getWorkingSetFile (vmID ),
216218 // FIXME (gh-807)
217- // InstanceSockAddr: resp.UPFSockPath ,
219+ InstanceSockAddr : resp .GetSocketPath () ,
218220 }
219221 if err := o .memoryManager .RegisterVM (stateCfg ); err != nil {
220222 return nil , nil , errors .Wrap (err , "failed to register VM with memory manager" )
@@ -497,7 +499,19 @@ func (o *Orchestrator) LoadSnapshot(ctx context.Context, vmID string, snap *snap
497499 conf .MemFilePath = snap .GetMemFilePath ()
498500 conf .ContainerSnapshotPath = containerSnap .GetDevicePath ()
499501
502+ if conf .MemBackend == nil {
503+ conf .MemBackend = & proto.MemoryBackend {}
504+ }
505+ conf .MemBackend .BackendType = fileBackend
506+ conf .MemBackend .BackendPath = snap .GetMemFilePath ()
507+
500508 if o .GetUPFEnabled () {
509+ conf .MemBackend .BackendType = uffdBackend
510+ conf .MemBackend .BackendPath , err = o .memoryManager .GetUPFSockPath (vmID )
511+ if err != nil {
512+ return nil , nil , errors .Wrapf (err , "failed to get UPF socket path for uffd backend" )
513+ }
514+
501515 if err := o .memoryManager .FetchState (vmID ); err != nil {
502516 return nil , nil , err
503517 }
0 commit comments