@@ -89,11 +89,11 @@ def build(self,
8989 fc_binary = None ,
9090 jailer_binary = None ,
9191 use_ramdisk = False ,
92- smt = None ):
92+ smt = None , daemonize = True ):
9393 """Build a fresh microvm."""
9494 vm = init_microvm (self .root_path , self .bin_cloner_path ,
9595 fc_binary , jailer_binary )
96-
96+ vm . jailer . daemonize = daemonize
9797 # Start firecracker.
9898 vm .spawn (use_ramdisk = use_ramdisk )
9999
@@ -173,10 +173,12 @@ def build_from_snapshot(self,
173173 # Enable incremental snapshot capability.
174174 diff_snapshots = False ,
175175 use_ramdisk = False ,
176- fc_binary = None , jailer_binary = None ):
176+ fc_binary = None , jailer_binary = None ,
177+ daemonize = True ):
177178 """Build a microvm from a snapshot artifact."""
178179 vm = init_microvm (self .root_path , self .bin_cloner_path ,
179180 fc_binary , jailer_binary ,)
181+ vm .jailer .daemonize = daemonize
180182 vm .spawn (log_level = 'Error' , use_ramdisk = use_ramdisk )
181183 vm .api_session .untime ()
182184
@@ -227,7 +229,8 @@ def build_from_snapshot(self,
227229 def build_from_artifacts (self , config ,
228230 kernel , disks , cpu_template ,
229231 net_ifaces = None , diff_snapshots = False ,
230- fc_binary = None , jailer_binary = None ):
232+ fc_binary = None , jailer_binary = None ,
233+ daemonize = True ):
231234 """Spawns a new Firecracker and applies specified config."""
232235 artifacts = ArtifactCollection (_test_images_s3_bucket ())
233236 # Pick the first artifact in the set.
@@ -253,10 +256,11 @@ def build_from_artifacts(self, config,
253256 diff_snapshots = diff_snapshots ,
254257 cpu_template = cpu_template ,
255258 fc_binary = fc_binary ,
256- jailer_binary = jailer_binary )
259+ jailer_binary = jailer_binary ,
260+ daemonize = daemonize )
257261
258262 def build_vm_nano (self , fc_binary = None , jailer_binary = None ,
259- net_ifaces = None , diff_snapshots = False ):
263+ net_ifaces = None , diff_snapshots = False , daemonize = True ):
260264 """Create a clean VM in an initial state."""
261265 return self .build_from_artifacts ("2vcpu_256mb" ,
262266 "vmlinux-4.14" ,
@@ -265,7 +269,8 @@ def build_vm_nano(self, fc_binary=None, jailer_binary=None,
265269 net_ifaces = net_ifaces ,
266270 diff_snapshots = diff_snapshots ,
267271 fc_binary = fc_binary ,
268- jailer_binary = jailer_binary )
272+ jailer_binary = jailer_binary ,
273+ daemonize = daemonize )
269274
270275 def build_vm_micro (self , fc_binary = None , jailer_binary = None ,
271276 net_ifaces = None , diff_snapshots = False ):
0 commit comments