httpserver: fix command line arguments

Currently no command line arguments are declared as accepting values,
for example --port 30000 will result in "port" being set but to an
empty value and 30000 will be ignored.

This does not affect parameters passed via cloud-init.

Reported-by: Or Cohen <orc@fewbytes.com>
Analysed-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: flush tlb lazily for cpus that are running system threads

Since OSv system threads do not access application's mmaped areas it is
possible to delay tlb flush on those cpus that do not run application
thread until next context switch time. This potentially avoids a lot of
IPIs in a workload that heavily uses mmap()/munmap(). This patch marks
threads that were created with pthread_create() as application threads
and add a logic int flush_tlb_all() to lazily flush tlb on a cpu that
runs non application thread. If non application thread does tlb flush
it happens eagerly, just like before.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
scripts: remove all unnecessary semicolon

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: remove all unnecessary parens after 'if' keyword

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: fix all bad-indentation (spaces)

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Jolokia: Ensure all requests are run with context classloader set

Internal lookups can fail/exception otherwise, esp. write case

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver: http headers should be treated case-insensitive

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver: HTTP body request content should not be dependent on "Content-Type"

Only Content-Length should determine the request body.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver: Do not pick up empty string as "allowed domain" for CORS

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver test: Don't kill OSv instance if running in "connect mode"

Server starts alive, server ends alive.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver tests: Trace REST API tests

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver tests: Jolokia REST API tests

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: top.py CLI replacement

Shows thread information from the API. It is advised to use this command
outside of an interactive shell since there's no proper way to stop it, yet,
except using ^C.

For example:
```
export OSV_API=http://192.168.122.89:8000
./cli -- top -s # :)
```

Closes #489.

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: fix comment describing locking in get_arcbuf

vn_lock is no longer taken when calling VOP_CACHE,
thus the locking description should be fixed.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Swagger API: clean the API to alligned to 1.2

This patch clean the swagger definition file so it could be validated
with a 1.2 swagger validator.

The main changes are:
all types are declared as "type"
all modules have an "id" field

The only code change result from this patch is the result of renaming
path parameter "if" to "intf" as "if" was rejected as a reserve word.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: use the host's build environment by default

We always use gcc from the host, so perhaps we should use the host's
gcc libs by default too. Currently the bare 'make' will fail with
gcc-4.9 because of incompatible gcc libs we have in external/.

See #474.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
setup.py: require libstdc++-static

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
java: add josvsym by default

It's needed to get JVM symbols in the backtrace.

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

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: default to external environment for cross-builds

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>