gdb: fix 'osv runqueue' on python3

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
bsd: make hash.h includeable from both C and C++ code

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: extract get_clockcycles() declaration to a header

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: reorder fields of struct random_adaptor to match initialization order

This is needed to make initializers using field designators work when
randomdev_soft.c is converted to C++. gcc-4.8 produces an error when
such initializers are used in a different order than the one from
struct definition.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: C++'ify source files realted to entropy harvesting

These files need to be converted so that a constructor to struct
harvest can be added.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
lockfree: align ring_spsc.emplace() to the STL standard

In STL emplace() constructs an element in place, passing its arguments
to the constructor. This change makes ring_spsc.emplace() and
unordered_ring_mpsc.emplace() behave the same.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
core: move unordered_ring_mpsc.hh form osv/ to lockfree/

That's where all lock-free data structures are now.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
httpserver: python3 support for json2code.py

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
scripts: add python3 support to test framework

Changes:
  - use python3 style print function.
  - use absolute imports which is enabled by default in python3.
  - add encode/decode between string and bytearray.
  - use python2 explicitly in 'scripts/trace.py', since it uses 'dpkt' library
    which is python2-only.

Tested with Python 3.4.1 and 2.7.8

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
scripts: add gcc 4.9 support to loader.py

Since the ABI of unordered_map changed in gcc 4.9.

Also removes tailing spaces.

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
build: use system gcc headers when build_env=host

Fixes the following error running 'tst-async.so' and 'tst-promise.so' due
to the ABI changes in gcc 4.9:

  Failed looking up symbol _ZTVNSt13__future_base11_State_baseE (vtable for std::__future_base::_State_base)

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
build.mk pass arch to the module compilation

The module compilation needs to the arch currently been compiled, this
adds the ARC as a parameter to the make file of the modules.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Adding libtools.so library

The libtools will hold code that is not part of the kernel but is
required by both tools and the API.

As a first step it holds the logic for lsroute and remove it from
kernel.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Add utilities for working with exceptions

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cloud-init: run before httpserver

Cloud init needs to run before anything else because it reads
configuration for anything else. Since httpserver, when included, will
now be run from /init, we need to make sure that cloud init runs
before it.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cloud-init: client: make connection time out after 1 second

The default timeout seems too long. 1 second seems more than enough to
ping the local meta data service.

Note on the implementation: There really seems to be no way to set
timeout using boost asio sync api. The author recommends using async
API and a timer to achieve that. This makes the code more bloated but
if we want to stick with boost asio we don't have a choice according
to my research.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cloud-init: client: support for setting HTTP headers

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cloud-init: client: introduce text() method for getting response contents

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cloud-init: client: do not throw when response code is not 200

Response code is not 200 should not be, in general, considered an
error of HTTP request. It is up to the higher layer to interpret it.
If we alwasy throw then the higher layer will have no chance of making
an interpretation of the result.

For example 404 when requesting an attribute may be perfectly fine (it
means the attribute is missing). We want to distinguish that from
actual connection error.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cloud-init: call load*() methods directly

It's simpler to call load() directly rather than fake user config by
constructing YAML nodes.

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