api/sched.h - improve const correctness

Some inline functions that do not modify a cpu_set cannot take a const
one. Noticed while trying to use this functions.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: allow migrating an existing thread

We already allow pinning a new thread to a particular CPU. This patch
allows moving an existing thread to a particular CPU. The new API is
currently limited to a thread moving itself, via a new function thread::pin()
and cannot be used by one thread to moving another thread.

There's a subtle point in a running thread migrating itself: It must not
start to run on the target CPU before it stops running on this CPU.
So this thread's code cannot "wake" itself on a remote CPU, or it might
run in two places concurrently for a short duration. So we need an
auxiliary thread to do this migration for us. Instead of re-using an
existing auxiliary thread (e.g., the load balancer), this patch takes
the quick-of-dirty approach of temporarily creating a new thread just
for this purpose. Since this function will likely be called rarely,
I believe this inefficient approach is "good enough".

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Support Linux affinity-setting functions

We already support the Linux pthread_attr_setaffinity_np() function to
pin a newly-created thread to a particular CPU. This patch adds support
for the Linux sched_setaffinity() and pthread_setaffinity_np() functions
which pin an existing thread to a CPU.

Currently, our support is limited to a one-cpu cpu set, and only to
pinning the calling thread (not one thread pinning another thread).
This is a useful case, as some thread APIs (including the one in C++11)
have no support for creating a pinned thread, so the users need to create
a thread and then have it pin itself.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests/misc-ctxsw - eliminate OSv-only code

Because OSv did not support the Linux function sched_setaffinity(),
we had in tests/misc-ctxsw.cc alternative OSv-only code. Now that
sched_setaffinity() is supported, we can drop this OSv-only code.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Update the Wiki URL in error message

Update the Wiki URL to match the new Wiki structure

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Tzach Livyatan <tzach@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
add option "nohalt" to use osv::poweroff() instead of osv::halt() if Guest aborted

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
drivers: add TIOCGWINSZ support to ioctl

ruby test script need TIOCGWINSZ.
hard-coded about window size to 80x25

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: add words for filtering error to tests/testing.py

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: add test script for CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Tester script to compile and execute tests

tester.py - compilation / execution of test dirctories

usage: Tester run [-h] [--config_param CONFIG_PARAM] directory
[directory ...]
usage: Tester compile [-h] [--config_param CONFIG_PARAM] directory
[directory ...]

can be used manually to compile/run tests

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
EC2 Tester script to launch an instance and run tests

ec2-tester.sh - ec2 tester script that will launch an EC2 instance for
tests and run the tests using tester.py

requires setting of AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY

usage: ec2_tester.sh [-h] [--help] [--src src] [--override-image image]
[--region region] [--zone zone] [--placement-group placement-group]
[--osv-version osv-version] test-directory ...

ec2-tester will:
- create an ami from a raw image
- start an instance using the ami
- verify the instance is accesible (ping)
- use tester.py to run tests toward the initiated instance
- clean all temporary item at the end

can be used manually to launch an EC2 instance and run tests

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
apps: update to latest

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>