@@ -89,11 +89,11 @@ def build(self,
89
89
fc_binary = None ,
90
90
jailer_binary = None ,
91
91
use_ramdisk = False ,
92
- smt = None ):
92
+ smt = None , daemonize = True ):
93
93
"""Build a fresh microvm."""
94
94
vm = init_microvm (self .root_path , self .bin_cloner_path ,
95
95
fc_binary , jailer_binary )
96
-
96
+ vm . jailer . daemonize = daemonize
97
97
# Start firecracker.
98
98
vm .spawn (use_ramdisk = use_ramdisk )
99
99
@@ -173,10 +173,12 @@ def build_from_snapshot(self,
173
173
# Enable incremental snapshot capability.
174
174
diff_snapshots = False ,
175
175
use_ramdisk = False ,
176
- fc_binary = None , jailer_binary = None ):
176
+ fc_binary = None , jailer_binary = None ,
177
+ daemonize = True ):
177
178
"""Build a microvm from a snapshot artifact."""
178
179
vm = init_microvm (self .root_path , self .bin_cloner_path ,
179
180
fc_binary , jailer_binary ,)
181
+ vm .jailer .daemonize = daemonize
180
182
vm .spawn (log_level = 'Error' , use_ramdisk = use_ramdisk )
181
183
vm .api_session .untime ()
182
184
@@ -227,7 +229,8 @@ def build_from_snapshot(self,
227
229
def build_from_artifacts (self , config ,
228
230
kernel , disks , cpu_template ,
229
231
net_ifaces = None , diff_snapshots = False ,
230
- fc_binary = None , jailer_binary = None ):
232
+ fc_binary = None , jailer_binary = None ,
233
+ daemonize = True ):
231
234
"""Spawns a new Firecracker and applies specified config."""
232
235
artifacts = ArtifactCollection (_test_images_s3_bucket ())
233
236
# Pick the first artifact in the set.
@@ -253,10 +256,11 @@ def build_from_artifacts(self, config,
253
256
diff_snapshots = diff_snapshots ,
254
257
cpu_template = cpu_template ,
255
258
fc_binary = fc_binary ,
256
- jailer_binary = jailer_binary )
259
+ jailer_binary = jailer_binary ,
260
+ daemonize = daemonize )
257
261
258
262
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 ):
260
264
"""Create a clean VM in an initial state."""
261
265
return self .build_from_artifacts ("2vcpu_256mb" ,
262
266
"vmlinux-4.14" ,
@@ -265,7 +269,8 @@ def build_vm_nano(self, fc_binary=None, jailer_binary=None,
265
269
net_ifaces = net_ifaces ,
266
270
diff_snapshots = diff_snapshots ,
267
271
fc_binary = fc_binary ,
268
- jailer_binary = jailer_binary )
272
+ jailer_binary = jailer_binary ,
273
+ daemonize = daemonize )
269
274
270
275
def build_vm_micro (self , fc_binary = None , jailer_binary = None ,
271
276
net_ifaces = None , diff_snapshots = False ):
0 commit comments