Skip to content

Commit bdca352

Browse files
committed
feat(balloon): allow balloon device with secret_free
Now that discard_range() uses fallocate(PUNCH_HOLE) for MAP_SHARED guest_memfd regions, the balloon can properly reclaim memory when secret_free is enabled. Remove the restriction that prevented combining balloon with secret_free. Signed-off-by: Jack Thomson <jackabt@amazon.com>
1 parent 950a024 commit bdca352

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/vmm/src/resources.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,6 @@ impl VmResources {
268268
return Err(MachineConfigError::IncompatibleBalloonSize);
269269
}
270270

271-
if self.balloon.get().is_some() && updated.secret_free {
272-
return Err(MachineConfigError::Incompatible(
273-
"balloon device",
274-
"secret freedom",
275-
));
276-
}
277271
if updated.secret_free {
278272
if self.vhost_user_devices_used() {
279273
return Err(MachineConfigError::Incompatible(
@@ -347,10 +341,6 @@ impl VmResources {
347341
return Err(BalloonConfigError::TooManyPagesRequested);
348342
}
349343

350-
if self.machine_config.secret_free {
351-
return Err(BalloonConfigError::IncompatibleWith("secret freedom"));
352-
}
353-
354344
self.balloon.set(config)
355345
}
356346

0 commit comments

Comments
 (0)