On Fri, Jun 26, 2015 at 04:49:36PM +0200, Marc-André Lureau wrote: > From: David Marchand <david.march...@6wind.com> > > When using ivshmem devices, notifications between guests can be sent as > interrupts using a ivshmem-server (typical use described in documentation). > The client is provided as a debug tool. > > Signed-off-by: Olivier Matz <olivier.m...@6wind.com> > Signed-off-by: David Marchand <david.march...@6wind.com> > Signed-off-by: Marc-André Lureau <marcandre.lur...@gmail.com> > [fix a valgrind warning and a server_close() segv, add server headers] > --- > Makefile | 8 + > configure | 3 + > contrib/ivshmem-client/ivshmem-client.c | 433 > ++++++++++++++++++++++++++++++++ > contrib/ivshmem-client/ivshmem-client.h | 212 ++++++++++++++++ > contrib/ivshmem-client/main.c | 239 ++++++++++++++++++ > contrib/ivshmem-server/ivshmem-server.c | 422 +++++++++++++++++++++++++++++++ > contrib/ivshmem-server/ivshmem-server.h | 164 ++++++++++++ > contrib/ivshmem-server/main.c | 264 +++++++++++++++++++ > qemu-doc.texi | 10 +- > 9 files changed, 1752 insertions(+), 3 deletions(-) > create mode 100644 contrib/ivshmem-client/ivshmem-client.c > create mode 100644 contrib/ivshmem-client/ivshmem-client.h > create mode 100644 contrib/ivshmem-client/main.c > create mode 100644 contrib/ivshmem-server/ivshmem-server.c > create mode 100644 contrib/ivshmem-server/ivshmem-server.h > create mode 100644 contrib/ivshmem-server/main.c >
(snip everything...) > + > +/** > + * Initialize an ivshmem server > + * > + * @server: A pointer to an uninitialized IvshmemServer structure > + * @unix_sock_path: The pointer to the unix socket file name > + * @shm_path: Path to the shared memory. The path corresponds to a > POSIX > + * shm name. To use a real file, for instance in a > hugetlbfs, > + * it is possible to use /../../abspath/to/file. This is only true with glibc < 2.19, see glibc commit b20de2c3d9d751eb259c321426188eefc64fcbe9, "Properly handle shm_open validation. Fixes bug 16274." (This probably isn't the right place to bring this up, but...) Would it make sense to turn ivshmem into a frontend for the hostmem backend? If we do that, then we can use hugetlbfs backed memory, and possibly get other benefits as well, right? Thanks, drew