scripts: Make release images include default configuration

Use 'make modules=' instead of 'make image=' in Capstan and VM image
release scripts to build things like cloud-init from default
configuration.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'stable/v0.14'
New "assigned virtio" API for applications

This patch adds a new experimental API, include/osv/virtio-assign.hh,
which an application can use if it wants to directly access a virtio
device that the host gave OSv - such as a virtio network device

Before a virtio device can be assigned to the application, OSv
needs to know not to use it itself. The boot-time option --assign-net
tells OSv *not* to use a virtio-net device given to it by the host
(if any), and instead assign it to the guest.

The application can then use osv::assigned_virtio::get() to get access
to this device (see include/osv/virtio-assign.hh for the full API),
and properly set it up and use it.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Fix most of the "-finstrument-functions" problems

The "conf-tracing=1" build option, which gives the compiler the
"-finstrument-functions" options, breaks the linking stage with a very
long list of missing functions (see issue #530).

Most of these errors involve functions from <x86intrin.h>. This header
defines functions as "extern inline __attribute__(__gnu_inline__)", an
arcane combination which basically tells gcc to make this function inline
*only*, without any possibility of writing this function independently.
But it appears that such functions also cannot be instrumented. So we
use an ugly #define trick to force these functions to also get the
"no_instrument_function" attribute, and avoid instrumenting them.

Unfortunately, there are more errors to fix, so issue #530 is still open.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Solve more "-finstrument-functions" problems

Solve more "-finstrument-functions" problems (see issue #530).

Our build.mk compiles the independent decompressing executable with
the regular CXXFLAGS, including "-finstrument-functions" if it includes
that - which won't work without the instrumentation functions.

So add "-fno-instrument-functions" when compiling the decompresser.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Fix build on gcc 4.8

Commit def5fbbb6ff9fd077ee5683c34bfd549fc745413 added
no_instrument_functions to a bunch of "extern inline" functions which
cannot be instrumented because they are only inlined. Unfortunately,
this doesn't work in gcc 4.8 because of a gcc bug only fixed in 4.9:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49718

So this patch undoes the fix of that patch, and insteads
tells the compiler, via a command line option, not to instrument anything
in those *mmintrin.h header. This also solves the original problem, and
works on gcc 4.8 as well.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Swagger Definition file: The reference to the api.json was missing

The api.json needs to be listed under the api-docs to be shown in the
swagger UI GUI.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Add a stop method to the server

This adds a stop method that stop the global server, allows to stop it
from the API.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Add a stop server API

This adds an API to stop the httpserver, if the httpserver is running in
the foreground it would cause the system to stop.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Support wildcard when searching for filename

This adds support for wildcard search in dirctory listing.

Both * and ? are supported, the match uses regular expression, where *
replaced by .* and ? replaced by .?.

A test for the wildcard was added.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Change option name from nohalt to power-off-on-abort

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Setting the download mode to file when seting the target file

The upload file mechanism got broken when additional option was added to send
information to the server.  This change first set the upload mode to file when
the temp_file name is set, it also cleans the file handler that do the upload,
by setting the target file before the download is starts.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Fix DMI table scanning on legacy systems

Even if we detect SMBIOS on a system, we also need to check that the DMI
table markers are there. While at it, also validate SMBIOS entry point
checksum.

Spotted during code inspection.

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

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
httpserver/osv-gui: update to latest

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
xenbus: get rid of the initialized trick

Use an instance() method as we do in other places.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
xenbus: add detach function

The device drivers can regiter a detach function, but we were so far using
only probe and attach. Add detach to the mix.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
xenfront: derive unit number from xenstore

We currently bump an integer and have that to be the index number.  However,
the interfaces are already indexed in the xenstore. Following a different
indexing scheme is possible and valid, but has the side effect that referring
to "interface 0" from outside the guest won't necessarily match the same
"interface 0" within it.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
xenfront: code teardown sequence

- Close our endpoint, so the backend will let the grants go.
- stop the network interface
- free each ring element and release grants
- free the rings themselves, as well as the remaining structures.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
xen: allow an interrupt handler to be unregistered

As part of the teardown process for a device, we need to be able to unregister
its interrupt handler. The driver layer will call it, but the function is
currently unimplemented.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>