Added 'add_fuel' command line option (#3792)

* Added 'add_fuel' command line option

* Added default value to 'add_fuel' config option

* Added 'add_fuel' to run command Store instantiation

* Added comment

* Added warning for add-fuel without consume-fuel

* Formatting

* Changed out --add-fuel and --consume-fuel to --fuel

* Formatting

* Update src/lib.rs

* Update src/commands/run.rs

Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
This commit is contained in:
Cameron Harris
2022-02-15 20:23:02 +02:00
committed by GitHub
parent ca0e8d0a1d
commit 85cf4b042a
2 changed files with 12 additions and 3 deletions

View File

@@ -164,6 +164,12 @@ impl RunCommand {
let engine = Engine::new(&config)?;
let mut store = Store::new(&engine, Host::default());
// If fuel has been configured, we want to add the configured
// fuel amount to this store.
if let Some(fuel) = self.common.fuel {
store.add_fuel(fuel)?;
}
let preopen_sockets = self.compute_preopen_sockets()?;
// Make wasi available by default.