Skip to content
Snippets Groups Projects
Commit 3615b885 authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

Power-off, instead of halt, when loader can't run command


Currently, when we try to run an invalid shared object (e.g, run.py -e aaa)
loader.cc calls abort(). This patch changes it to use osv::poweroff().

This is useful, for example, to measure how much time our boot/poweroff
cycle takes, without running any payload, by doing

	time scripts/run.py -e aaa

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent e5cf0f1d
No related branches found
No related tags found
No related merge requests found
......@@ -201,8 +201,8 @@ void run_main(elf::program *prog, struct argblock *args)
// keeping a reference to it in the free store.
auto obj = *(new std::shared_ptr<elf::object>(prog->get_library(av[0])));
if (!obj) {
debug("run_main(): cannot execute %s. Aborting.\n", av[0]);
abort();
debug("run_main(): cannot execute %s. Powering off.\n", av[0]);
osv::poweroff();
}
auto main = obj->lookup<void (int, char**)>("main");
assert(main);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment