setup.py: add support for Ubuntu 13.10

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
net: Remove socket access dead code

They are not used at all.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
freq.py: calculate column widths dynamically

Some tracepoints have names longer than the fixed 15 characters which
results in a hard to read table. Let's adjust column width to the
tracepoint name length, with a minimum width of 15, as before.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: Fix vget() error handling

The return type of vget() is int but unfortunately GCC does not complain
when we attempt to return NULL.

Spotted after converting VFS to use nullptr.

Reviewed-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: Use nullptr in C++ code

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

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Jiao Xiang <jxwr.cn@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
percpu.hh: Fix pointer arithmetic

Fixes the following complaint by GCC:

  In file included from ../../include/osv/per-cpu-counter.hh:13:0,
                   from ../../include/osv/trace-count.hh:10,
                   from api/trace.cc:20:
  ../../include/osv/percpu.hh: In instantiation of ‘T* dynamic_percpu<T, align>::addr(void*) [with T = long unsigned int; long unsigned int align = 8ul]’:
  ../../include/osv/percpu.hh:85:19:   required from ‘void dynamic_percpu<T, align>::construct() [with T = long unsigned int; long unsigned int align = 8ul]’
  ../../include/osv/percpu.hh:68:56:   required from ‘dynamic_percpu<T, align>::dynamic_percpu() [with T = long unsigned int; long unsigned int align = 8ul]’
  ../../include/osv/per-cpu-counter.hh:18:7:   required from here
  ../../include/osv/percpu.hh:88:37: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
           return static_cast<T*>(base + _offset);

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
setup.py: fix regression on Ubuntu 14.04/Fedora 20

This patch fixes a "no attribute" error:

Traceback (most recent call last):
  File "./scripts/setup.py", line 98, in <module>
    if dver.ec2_post_install:
AttributeError: type object 'Ubuntu_14_04' has no attribute 'ec2_post_install'

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
poll: Fix two indention

Spotted during code inspection.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader: remove unused extern declaration

This is no longer used after 1146a63e26af89df1e640b954cff5be46ef6224d.

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Adding the osv-gui is a submodule of the httpserver

This adds the OSV-GUI repository as a submodule of the httpserver

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Compile and copy the gui to the image

The httpserver compilation needs to verify that the gui submodule was
pulled, compile and add it as part of the image.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Httpserver: Mapping the GUI files in the server

This adds a mapping of the GUI to the server, after this patch a call to
http://192.168.122.89:8000/dashboard/
Will display the GUI.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: don't place mnttab.o in source directory

Breaks cross-arch build.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
net: Kill unused struct protosw inetsw[]

It is #if 0'd.

Spotted during code inspection.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: don't place mnttab.o in source directory (again)

Found in another place.

Breaks cross-arch build.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-async: migration lock is enough

As Nadav pointed out tst-async disabled preemption only to make sure
that two function calls happen on the same CPU. For that purpose migration
lock is sufficient.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
runtime: stub __cxa_thread_atexit_impl

Needed for gcc 4.9.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: avoid recursive locking on vp when checking vnode refcnt

vcount is used to get vnode refcnt amount, which unnecessarily takes
another lock for the same vnode.
Found it while auditing the code.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: change default timeslice length

This patch changes the "thyst" (hysteresis time) scheduler paramter from
2ms to 5ms.

It can be shown that when when two CPU-hog threads compete they alternate
running in timeslices of length 2*thyst. I.e., after this patch the time
slice in that case will be 10ms, exactly as happens in Linux (as was
measured by tests/misc-timeslice.cc).

thyst also caps the number of preemption-timer setting operations (which
require slow APIC exits) to 1/thyst - i.e., 200 a second.

Please note that the ideal time slice defined by thyst is rarely achieved
in practice, as waking a low-runtime thread can cause a context switch
long before the full time slice was used. For example, network I/O handling
threads are often woken many thousands of times a second; As another example,
our "page access scanner" thread wakes up (on one CPU) every 1ms and runs
for a very short duration, after which a rescheduling occurs, so in the
above example we will switch between the two CPU-hugging thread every 1ms,
instead of every 5ms.

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