libc: fix __unused name collision

__unused is used in libc for some unused field, and also by bsd to mark
unused arguments.  Change the libc instance to resolve include conflicts.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
rcu hashtable: add size() and empty()

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
epoll: add support for EPOLLONESHOT

Fixes #413.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: epoll: add test for EPOLLONESHOT

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'stable/v0.11'
vfs: stub lchown

We already stub chown and fchown. rpm hits lchown in some package installations.
I haven't looked in detail, but it is very likely that it happens when installing
symlinks.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
apps: update

Asias He (1):
      tomcat-benchmark: update clean target

Dmitry Fleytman (5):
      apps/tomcat: introduce script for EC2 test automation
      apps/tomcat: fix PerfPublisher XML generation
      tomcat-ec2: introduce instance placement parameters
      apps/tomcat-ec2: move script to jenkins subdir
      apps/netperf: add scripts for EC2 testing with Jenkins

Glauber Costa (1):
      add basic rpm support

KANATSU Minoru (1):
      Remove Makefile bug

KANATSU Minroru (1):
      Add README for build and use Ruby on Rails

Nadav Har'El (1):
      jython: Add default command line

Pekka Enberg (3):
      cassandra: Fix multiple invocations of GET script
      Add ROOTFS to gitignore
      cassandra: Remove start-cassandra script

Tomasz Grabiec (2):
      Add 'wrk' module
      jython: adapt to a module

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
memory: don't allocate huge page range if it is not big enough

That's embarassing. It is obviously possible that even the largest of the
huge page ranges is not big enough, so blindly taking the biggest huge
area and trying to use it in allocation without any size check is a very
wrong thing to do. Found while looking at the code.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader.py: get free memory from memory::free_memory

As Zifei suggested there is no need to iterate over all unallocated
page ranges to get the amount of free memory.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
memory: call on_alloc()/on_free() hooks in bitmap allocation

page_range_allocator::_bitmap, because of its special role, uses custom
allocator. There is no reason, though, not to call on_alloc() and on_free()
hooks.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
memory: don't allocate huge page range if it is not big enough

That's embarassing. It is obviously possible that even the largest of the
huge page ranges is not big enough, so blindly taking the biggest huge
area and trying to use it in allocation without any size check is a very
wrong thing to do. Found while looking at the code.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
memory: update memory allocation related comments

Recent changes in memory allocation algorithms made some of the comments
outdated.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Merge branch 'stable/v0.11'
Fix empty-path case of futimesat()

The Linux futimesat(2) specifies that:

  Glibc notes: If pathname is  NULL, then the glibc futimesat() wrapper
  function updates the times for the file referred to by dirfd.

In other words, when pathname==NULL, futimesat() behaves like futimes(),
at this works whether or not the given fd is a directory.

We did not support this corner case, and it turns out that OpenJDK
uses exactly this case: futimesat(fd, NULL, times), so not supporting
this resulted in weird "Not a directory" message when trying to change
the times of a non-directory file.

Since futimes(fd, times) is equivalent to the newly fixed
futimesat(fd, NULL, times), we also implement the former function (missing
until now) by calling the latter.

Fixes #425 (Lyor, please confirm).

This patch also adds tests for this case.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'stable/v0.11'
mgmt: update to latest

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'stable/v0.11'
init_prio::apic was never used, git log -Sinit_prio::apic finds nothing

Signed-off-by: Elazar Leibovich <elazarl@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: do not open code s_program

This is just to make the upcoming ELF namespaces patch smaller, since it is
quite independent. This is the only open coded user so far.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add dependency of ifconfig in libtools

This adds library dependency of the ifconfig.so with libtools.so.
The problem arises in images that does not contain the api and are manually added the
ifconfig.so

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