[Qemu-devel] [PATCH v5 1/7] Convert -mem-path to QemuOpts and add prealloc, share and unlink properties

2014-01-09 Thread Antonios Motakis
Extend -mem-path with additional properties: - prealloc=on|off - default off, same as -mem-prealloc - share=on|off - default off, memory is mmapped with MAP_SHARED flag - unlink=on|off - default on, inlink the file after openinng it Signed-off-by: Antonios Motakis Signed-off-by: Nikolay

[Qemu-devel] [PATCH v5 6/7] Add new vhost-user netdev backend

2014-01-09 Thread Antonios Motakis
Add a new QEMU netdev backend that is intended to invoke vhost_net with the vhost-user backend. Also decouple virtio-net from the tap backend. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hmp-commands.hx | 4 +- hw/net/vhost_net.c | 66

[Qemu-devel] [PATCH v5 4/7] Add domain socket communication for vhost-user backend

2014-01-09 Thread Antonios Motakis
SCM_RIGHTS type in the message control header. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/vhost-backend.c | 268 +- 1 file changed, 263 insertions(+), 5 deletions(-) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost

[Qemu-devel] [PATCH v5 3/7] Add vhost-user skeleton

2014-01-09 Thread Antonios Motakis
Add empty vhost_call, init and cleanup for the vhost-user backend. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 57 ++- hw/virtio/vhost-backend.c | 35 include/hw

[Qemu-devel] [PATCH v5 0/7] Vhost and vhost-net support for userspace based backends

2014-01-09 Thread Antonios Motakis
le descriptor leak Changes from v2: - Reconnect when the backend disappears Changes from v1: - Implementation of vhost-user netdev backend - Code improvements Antonios Motakis (7): Convert -mem-path to QemuOpts and add prealloc,share and unlink properties Decouple vhost from kernel interf

[Qemu-devel] [PATCH v5 7/7] Add vhost-user reconnection

2014-01-09 Thread Antonios Motakis
At runtime vhost-user netdev will detect if the vhost backend is up or down. Upon disconnection it will set link_down accordingly and notify virtio-net. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 16 +++ hw/virtio/vhost

[Qemu-devel] [PATCH v5 2/7] Decouple vhost from kernel interface

2014-01-09 Thread Antonios Motakis
nly in the vhost-backend (ioctl, open, close). Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 13 +--- hw/scsi/vhost-scsi.c | 13 +--- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-backend.c |

[Qemu-devel] [PATCH v5 5/7] Add vhost-user calls implementation

2014-01-09 Thread Antonios Motakis
fds array for inclusion in the sendmsd control header. VHOST_SET_MEM_TABLE ignores the supplied vhost_memory structure and scans the global ram_list for ram blocks wiht a valid fd field set. This would be set when the -mem-path option with shared=on property is used. Signed-off-by: Antonios

Re: [Qemu-devel] [PATCH v5 0/7] Vhost and vhost-net support for userspace based backends

2014-01-10 Thread Antonios Motakis
On Thu, Jan 9, 2014 at 5:11 PM, Michael S. Tsirkin wrote: > On Thu, Jan 09, 2014 at 03:59:54PM +0100, Antonios Motakis wrote: > > In this patch series we would like to introduce our approach for putting > a > > virtio-net backend in an external userspace process. Our event

Re: [Qemu-devel] [PATCH v5 7/7] Add vhost-user reconnection

2014-01-10 Thread Antonios Motakis
On Thu, Jan 9, 2014 at 5:16 PM, Michael S. Tsirkin wrote: > On Thu, Jan 09, 2014 at 04:00:01PM +0100, Antonios Motakis wrote: > > At runtime vhost-user netdev will detect if the vhost backend is up or > down. > > Upon disconnection it will set link_down accordingly and n

Re: [Qemu-devel] [PATCH v5 6/7] Add new vhost-user netdev backend

2014-01-10 Thread Antonios Motakis
On Thu, Jan 9, 2014 at 5:14 PM, Michael S. Tsirkin wrote: > On Thu, Jan 09, 2014 at 04:00:00PM +0100, Antonios Motakis wrote: > > Add a new QEMU netdev backend that is intended to invoke vhost_net > > with the vhost-user backend. Also decouple virtio-net from the tap > > ba

Re: [Qemu-devel] [PATCH v5 1/7] Convert -mem-path to QemuOpts and add prealloc, share and unlink properties

2014-01-10 Thread Antonios Motakis
On Thu, Jan 9, 2014 at 5:01 PM, Michael S. Tsirkin wrote: > On Thu, Jan 09, 2014 at 03:59:55PM +0100, Antonios Motakis wrote: > > Extend -mem-path with additional properties: > > > > - prealloc=on|off - default off, same as -mem-prealloc > > - share=on|off - default

Re: [Qemu-devel] [PATCH v5 5/7] Add vhost-user calls implementation

2014-01-10 Thread Antonios Motakis
On Thu, Jan 9, 2014 at 4:47 PM, Michael S. Tsirkin wrote: > On Thu, Jan 09, 2014 at 03:59:59PM +0100, Antonios Motakis wrote: > > Each ioctl request of vhost-kernel has a vhost-user message equivalent, > > which is sent it over the control socket. > > > > The general a

Re: [Qemu-devel] [PATCH v5 4/7] Add domain socket communication for vhost-user backend

2014-01-10 Thread Antonios Motakis
On Thu, Jan 9, 2014 at 4:31 PM, Michael S. Tsirkin wrote: > On Thu, Jan 09, 2014 at 03:59:58PM +0100, Antonios Motakis wrote: >> Add structures for passing vhost-user messages over a unix domain socket. >> This is the equivalent of the existing vhost-kernel ioctls. >> >>

[Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-13 Thread Antonios Motakis
n the backend disappears Changes from v1: - Implementation of vhost-user netdev backend - Code improvements Antonios Motakis (8): Convert -mem-path to QemuOpts and add prealloc and share properties New -mem-path option - unlink. Decouple vhost from kernel interface Add vhost-user skeleton

[Qemu-devel] [PATCH v6 1/8] Convert -mem-path to QemuOpts and add prealloc and share properties

2014-01-13 Thread Antonios Motakis
Extend -mem-path with additional properties: - prealloc=on|off - default off, same as -mem-prealloc - share=on|off - default off, memory is mmapped with MAP_SHARED flag Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- exec.c | 41

[Qemu-devel] [PATCH v6 3/8] Decouple vhost from kernel interface

2014-01-13 Thread Antonios Motakis
nly in the vhost-backend (ioctl, open, close). Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 13 +--- hw/scsi/vhost-scsi.c | 13 +--- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-backend.c |

[Qemu-devel] [PATCH v6 8/8] Add vhost-user reconnection

2014-01-13 Thread Antonios Motakis
option: -netdev vhost-user,path=/path/to/sock[,poll_time=poll_time] Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 16 + hw/virtio/vhost-backend.c | 25 -- include/hw/virtio/vhost-backend.h | 2 ++ include

[Qemu-devel] [PATCH v6 4/8] Add vhost-user skeleton

2014-01-13 Thread Antonios Motakis
Add empty vhost_call, init and cleanup for the vhost-user backend. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 57 ++- hw/virtio/vhost-backend.c | 35 include/hw

[Qemu-devel] [PATCH v6 2/8] New -mem-path option - unlink.

2014-01-13 Thread Antonios Motakis
The unlink option allows the created file to be externally deleted after QEMU is terminated. - unlink=on|off - default on, unlink the file after opening it Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- exec.c | 18 +- qemu-options.hx | 7

[Qemu-devel] [PATCH v6 5/8] Add domain socket communication for vhost-user backend

2014-01-13 Thread Antonios Motakis
SCM_RIGHTS type in the message control header. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/vhost-backend.c | 306 +- 1 file changed, 301 insertions(+), 5 deletions(-) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost

[Qemu-devel] [PATCH v6 6/8] Add vhost-user calls implementation

2014-01-13 Thread Antonios Motakis
for inclusion in the sendmsd control header. VHOST_SET_MEM_TABLE ignores the supplied vhost_memory structure and scans the global ram_list for ram blocks with a valid fd field set. This would be set when the -mem-path option with shared=on property is used. Signed-off-by: Antonios Motakis Signed

[Qemu-devel] [PATCH v6 7/8] Add new vhost-user netdev backend

2014-01-13 Thread Antonios Motakis
Add a new QEMU netdev backend that is intended to invoke vhost_net with the vhost-user backend. Also decouple virtio-net from the tap backend. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hmp-commands.hx | 4 +- hw/net/vhost_net.c | 66

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-14 Thread Antonios Motakis
On Tue, Jan 14, 2014 at 12:33 PM, Michael S. Tsirkin wrote: > On Mon, Jan 13, 2014 at 03:25:11PM +0100, Antonios Motakis wrote: > > In this patch series we would like to introduce our approach for putting > a > > virtio-net backend in an external userspace process. Our event

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-14 Thread Antonios Motakis
Hello, On Tue, Jan 14, 2014 at 12:14 PM, Michael S. Tsirkin wrote: > On Mon, Jan 13, 2014 at 03:25:11PM +0100, Antonios Motakis wrote: > > In this patch series we would like to introduce our approach for putting > a > > virtio-net backend in an external userspace process. O

Re: [Qemu-devel] [PATCH v6 2/8] New -mem-path option - unlink.

2014-01-14 Thread Antonios Motakis
On Tue, Jan 14, 2014 at 12:16 PM, Michael S. Tsirkin wrote: > On Mon, Jan 13, 2014 at 03:25:13PM +0100, Antonios Motakis wrote: > > The unlink option allows the created file to be externally deleted > > after QEMU is terminated. > > > > - unlink=on|off - defaul

Re: [Qemu-devel] [PATCH v6 6/8] Add vhost-user calls implementation

2014-01-14 Thread Antonios Motakis
On Tue, Jan 14, 2014 at 12:21 PM, Michael S. Tsirkin wrote: > On Mon, Jan 13, 2014 at 03:25:17PM +0100, Antonios Motakis wrote: > > Each ioctl request of vhost-kernel has a vhost-user message equivalent, > > which is sent over the control socket. > > > > The general a

Re: [Qemu-devel] [PATCH v6 5/8] Add domain socket communication for vhost-user backend

2014-01-14 Thread Antonios Motakis
On Tue, Jan 14, 2014 at 12:10 PM, Michael S. Tsirkin wrote: > On Mon, Jan 13, 2014 at 03:25:16PM +0100, Antonios Motakis wrote: > > Add structures for passing vhost-user messages over a unix domain socket. > > This is the equivalent of the existing vhost-kernel ioctls. > &g

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-15 Thread Antonios Motakis
On Wed, Jan 15, 2014 at 10:07 AM, Michael S. Tsirkin wrote: > On Tue, Jan 14, 2014 at 07:13:43PM +0100, Antonios Motakis wrote: > > > > > > > > On Tue, Jan 14, 2014 at 12:33 PM, Michael S. Tsirkin > wrote: > > > > On Mon, Jan 13, 2014 a

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-16 Thread Antonios Motakis
On Wed, Jan 15, 2014 at 3:49 PM, Michael S. Tsirkin wrote: > On Wed, Jan 15, 2014 at 01:50:47PM +0100, Antonios Motakis wrote: > > > > > > > > On Wed, Jan 15, 2014 at 10:07 AM, Michael S. Tsirkin > wrote: > > > > On Tue, Jan 14, 2014 a

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-21 Thread Antonios Motakis
On Wed, Jan 15, 2014 at 10:07 AM, Michael S. Tsirkin wrote: > On Tue, Jan 14, 2014 at 07:13:43PM +0100, Antonios Motakis wrote: >> >> >> >> On Tue, Jan 14, 2014 at 12:33 PM, Michael S. Tsirkin wrote: >> >> On Mon, Jan 13, 2014 at 03:25:11PM +0100, A

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-21 Thread Antonios Motakis
Hello, On Wed, Jan 15, 2014 at 11:05 AM, Michael S. Tsirkin wrote: > > On Mon, Jan 13, 2014 at 03:25:11PM +0100, Antonios Motakis wrote: > > In this patch series we would like to introduce our approach for putting a > > virtio-net backend in an external userspace process. Our

[Qemu-devel] [PATCH v8 00/17] Vhost and vhost-net support for userspace based backends

2014-02-13 Thread Antonios Motakis
3: - Convert -mem-path to QemuOpts with prealloc, share and unlink properties - Set 1 sec timeout when read/write to the unix domain socket - Fix file descriptor leak Changes from v2: - Reconnect when the backend disappears Changes from v1: - Implementation of vhost-user netdev backend - C

[Qemu-devel] [PATCH v8 05/17] Add G_IO_HUP handler for socket chardev

2014-02-13 Thread Antonios Motakis
This is used to detect that the remote end has disconnected. Just call tcp_char_disconnect on receiving this event. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- qemu-char.c | 16 1 file changed, 16 insertions(+) diff --git a/qemu-char.c b/qemu-char.c

[Qemu-devel] [PATCH v8 03/17] Add chardev API qemu_chr_fe_set_msgfds

2014-02-13 Thread Antonios Motakis
This will set an array of file descriptors to the internal structures. The next time a message is sent the array will be sent as ancillary data. This feature works with the Unix domain socket backend only. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu

[Qemu-devel] [PATCH v8 01/17] Convert -mem-path to QemuOpts and add prealloc and share properties

2014-02-13 Thread Antonios Motakis
Extend -mem-path with additional properties: - prealloc=on|off - default off, same as -mem-prealloc - share=on|off - default off, memory is mmapped with MAP_SHARED flag Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- exec.c | 30

[Qemu-devel] [PATCH v8 02/17] Add chardev API qemu_chr_fe_read_all

2014-02-13 Thread Antonios Motakis
This function will attempt to read data from the chardev trying to fill the buffer up to the given length. Add tcp_chr_disconnect to reuse disconnection code where needed. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h | 14 + qemu-char.c

[Qemu-devel] [PATCH v8 06/17] vhost_net should call the poll callback only when it is set

2014-02-13 Thread Antonios Motakis
The poll callback needs to be called when bringing up or down the vhost_net instance. As it is not mandatory for an NetClient to implement it, invoke it only when it is set. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 13 ++--- 1 file

[Qemu-devel] [PATCH v8 11/17] Add vhost-backend and VhostBackendType

2014-02-13 Thread Antonios Motakis
Use vhost_set_backend_type to initialise a proper vhost_ops structure. In vhost_net_init and vhost_net_start_one call conditionally TAP related initialisation depending on the vhost backend type. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v8 04/17] Add chardev API qemu_chr_fe_get_msgfds

2014-02-13 Thread Antonios Motakis
This extends the existing qemu_chr_fe_get_msgfd by allowing to read a set of fds. The function for receiving the fds - unix_process_msgfd is extended to allocate the needed array size. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h | 15

[Qemu-devel] [PATCH v8 07/17] Refactor virtio-net to use generic get_vhost_net

2014-02-13 Thread Antonios Motakis
This decouples virtio-net from the TAP netdev backend and allows support for other backends to be implemented. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 30 +++--- hw/net/virtio-net.c | 39

[Qemu-devel] [PATCH v8 08/17] vhost_net_init will use VhostNetOptions to get all its arguments

2014-02-13 Thread Antonios Motakis
pass the fd. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 24 +--- hw/scsi/vhost-scsi.c | 10 +- hw/virtio/vhost.c | 12 +++- include/hw/virtio/vhost.h | 2 +- include/net/vhost_net.h | 8

[Qemu-devel] [PATCH v8 14/17] Add the vhost-user netdev backend to the command line

2014-02-13 Thread Antonios Motakis
checks for validity: - requires `-mempath ...,share=on` - requires `-device virtio-net-*` The `vhostforce` option is uset to force vhost-net when we deal with no-MSIX guest. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hmp-commands.hx | 4 +- hw/net/vhost_net.c

[Qemu-devel] [PATCH v8 12/17] Add vhost-user as a vhost backend

2014-02-13 Thread Antonios Motakis
global ram_list for ram blocks with a valid fd field set. This would be set when the -mem-path option with shared=on property is used. Upon receiving VHOST_USER_GET_FEATURES reply, the new features value is compared to the mandatory features in the vhost_dev. Signed-off-by: Antonios Motakis Signed

[Qemu-devel] [PATCH v8 10/17] Add mandatory_features to vhost_dev

2014-02-13 Thread Antonios Motakis
This will be used in a following patch to ensure that a vhost-user client reconnecting to QEMU supports the features that were exposed by the first client that initiated the virtio-net session. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 10

[Qemu-devel] [PATCH v8 15/17] Add vhost-user protocol documentation

2014-02-13 Thread Antonios Motakis
This document describes the basic message format used by vhost-user for communication over a unix domain socket. The protocol is based on the existing ioctl interface used for the kernel version of vhost. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- docs/specs/vhost

[Qemu-devel] [PATCH v8 09/17] Add vhost_ops to vhost_dev struct and replace all relevant ioctls

2014-02-13 Thread Antonios Motakis
Decouple vhost from the Linux kernel by introducing vhost_ops. The intention is to provide different backends - 'kernel' backend based on the ioctl interface, and 'user' backend based on an Unix domain socket and shared memory. Signed-off-by: Antonios Motakis Signed-off-

[Qemu-devel] [PATCH v8 13/17] Add new vhost-user netdev backend

2014-02-13 Thread Antonios Motakis
slave is compatible with the first one. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/net/vhost-user.h | 17 ++ net/Makefile.objs| 2 +- net/clients.h| 3 + net/vhost-user.c | 150 +++

[Qemu-devel] [PATCH v8 16/17] libqemustub: add stubs to be able to use qemu-char.c

2014-02-13 Thread Antonios Motakis
tify_event - vc_init and this array: - serial_hds Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- stubs/Makefile.objs | 8 stubs/bdrv-commit-all.c | 7 +++ stubs/chr-msmouse.c | 7 +++ stubs/get-next-serial.c | 3 +++ stubs/is-daemonized

[Qemu-devel] [PATCH v8 17/17] Add qtest for vhost-user

2014-02-13 Thread Antonios Motakis
ount point defaults to '/hugetlbfs' and can be specified via the environment variable QTEST_HUGETLBFS_PATH. The rom pc-bios/pxe-virtio.rom is used to instantiate a virtio pcicontroller. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- tests/Makefile | 4

Re: [Qemu-devel] [PATCH v8 01/17] Convert -mem-path to QemuOpts and add prealloc and share properties

2014-02-17 Thread Antonios Motakis
On Mon, Feb 17, 2014 at 8:56 AM, Michael S. Tsirkin wrote: > On Mon, Feb 17, 2014 at 12:42:45AM +0100, Paolo Bonzini wrote: > > Il 15/02/2014 19:10, Michael Tokarev ha scritto: > > > 13 февраля 2014 г. 16:03:12 GMT+04:00, Antonios Motakis < > a.mota...@virtu

[Qemu-devel] [PATCH v9 07/20] vhost_net should call the poll callback only when it is set

2014-03-04 Thread Antonios Motakis
The poll callback needs to be called when bringing up or down the vhost_net instance. As it is not mandatory for an NetClient to implement it, invoke it only when it is set. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 13 ++--- 1 file

[Qemu-devel] [PATCH v9 08/20] Refactor virtio-net to use generic get_vhost_net

2014-03-04 Thread Antonios Motakis
This decouples virtio-net from the TAP netdev backend and allows support for other backends to be implemented. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 30 +++--- hw/net/virtio-net.c | 29

[Qemu-devel] [PATCH v9 10/20] Gracefully handle ioctl failure in vhost_virtqueue_stop

2014-03-04 Thread Antonios Motakis
still we keep a sane value and can continue on reconnect. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 9e336ad..322e2c0 100644 --- a/hw

[Qemu-devel] [PATCH v9 06/20] Add G_IO_HUP handler for socket chardev

2014-03-04 Thread Antonios Motakis
This is used to detect that the remote end has disconnected. Just call tcp_char_disconnect on receiving this event. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- qemu-char.c | 16 1 file changed, 16 insertions(+) diff --git a/qemu-char.c b/qemu-char.c

[Qemu-devel] [PATCH v9 17/20] Add the vhost-user netdev backend to the command line

2014-03-04 Thread Antonios Motakis
checks for validity: - requires `-mempath ...,share=on` - requires `-device virtio-net-*` The `vhostforce` option is used to force vhost-net when we deal with non-MSIX guests. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hmp-commands.hx| 4 +- hw/net/vhost_net.c

[Qemu-devel] [PATCH v9 05/20] Add chardev API qemu_chr_fe_get_msgfds

2014-03-04 Thread Antonios Motakis
This extends the existing qemu_chr_fe_get_msgfd by allowing to read a set of fds. The function for receiving the fds - unix_process_msgfd is extended to allocate the needed array size. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h | 15

[Qemu-devel] [PATCH v9 12/20] Add vhost_ops to vhost_dev struct and replace all relevant ioctls

2014-03-04 Thread Antonios Motakis
Decouple vhost from the Linux kernel by introducing vhost_ops. The intention is to provide different backends - a 'kernel' backend based on the ioctl interface, and an 'user' backend based on a UNIX domain socket and shared memory interface. Signed-off-by: Antonios Motakis Si

[Qemu-devel] [PATCH v9 20/20] Add qtest for vhost-user

2014-03-04 Thread Antonios Motakis
ount point defaults to '/hugetlbfs' and can be specified via the environment variable QTEST_HUGETLBFS_PATH. The rom pc-bios/pxe-virtio.rom is used to instantiate a virtio pcicontroller. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- tests/Makefile | 4

[Qemu-devel] [PATCH v9 16/20] Add new vhost-user netdev backend

2014-03-04 Thread Antonios Motakis
compatible with the first one. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/net/vhost-user.h | 17 ++ net/Makefile.objs| 2 +- net/clients.h| 3 + net/vhost-user.c | 150 +++

[Qemu-devel] [PATCH v9 18/20] Add vhost-user protocol documentation

2014-03-04 Thread Antonios Motakis
This document describes the basic message format used by vhost-user for communication over a unix domain socket. The protocol is based on the existing ioctl interface used for the kernel version of vhost. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- docs/specs/vhost

[Qemu-devel] [PATCH v9 02/20] Add kvm_eventfds_enabled function

2014-03-04 Thread Antonios Motakis
Add a function to check if the eventfd capability is present in KVM in the host kernel. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/kvm.h | 11 +++ kvm-all.c| 4 kvm-stub.c | 1 + 3 files changed, 16 insertions

[Qemu-devel] [PATCH v9 09/20] Add new virtio API virtio_queue_get_avail_idx

2014-03-04 Thread Antonios Motakis
This function allows to get the current available ring index. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/virtio.c | 5 + include/hw/virtio/virtio.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v9 11/20] vhost_net_init will use VhostNetOptions to get all its arguments

2014-03-04 Thread Antonios Motakis
pass the fd. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 23 --- hw/scsi/vhost-scsi.c | 10 +- hw/virtio/vhost.c | 12 +++- include/hw/virtio/vhost.h | 2 +- include/net/vhost_net.h | 8

Re: [Qemu-devel] [PATCH v9 00/20] Vhost and vhost-net support for userspace based backends

2014-03-04 Thread Antonios Motakis
On Tue, Mar 4, 2014 at 7:29 PM, Paolo Bonzini wrote: > Il 04/03/2014 19:22, Antonios Motakis ha scritto: > > In this patch series we would like to introduce our approach for putting a >> virtio-net backend in an external userspace process. Our eventual target >> is to >&

[Qemu-devel] [PATCH v9 00/20] Vhost and vhost-net support for userspace based backends

2014-03-04 Thread Antonios Motakis
, share and unlink properties - Set 1 sec timeout when read/write to the unix domain socket - Fix file descriptor leak Changes from v2: - Reconnect when the backend disappears Changes from v1: - Implementation of vhost-user netdev backend - Code improvements Antonios Motakis (20):

[Qemu-devel] [PATCH v9 04/20] Add chardev API qemu_chr_fe_set_msgfds

2014-03-04 Thread Antonios Motakis
This will set an array of file descriptors to the internal structures. The next time a message is send the array will be send as ancillary data. This feature works on the UNIX domain socket backend only. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h

[Qemu-devel] [PATCH v9 14/20] Add vhost-backend and VhostBackendType

2014-03-04 Thread Antonios Motakis
Use vhost_set_backend_type to initialise a proper vhost_ops structure. In vhost_net_init and vhost_net_start_one call conditionally TAP related initialisation depending on the vhost backend type. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v9 03/20] Add chardev API qemu_chr_fe_read_all

2014-03-04 Thread Antonios Motakis
This function will attempt to read data from the chardev trying to fill the buffer up to the given length. Add tcp_chr_disconnect to reuse disconnection code where needed. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h | 14 + qemu-char.c

[Qemu-devel] [PATCH v9 13/20] Add mandatory_features to vhost_dev

2014-03-04 Thread Antonios Motakis
This will be used in a following patch to ensure that a vhost-user client reconnecting to QEMU supports the features that were exposed by the first client that initiated the virtio-net session. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 10

[Qemu-devel] [PATCH v9 19/20] libqemustub: add stubs to be able to use qemu-char.c

2014-03-04 Thread Antonios Motakis
tify_event - vc_init and this array: - serial_hds Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- stubs/Makefile.objs | 8 stubs/bdrv-commit-all.c | 7 +++ stubs/chr-msmouse.c | 7 +++ stubs/get-next-serial.c | 3 +++ stubs/is-daemonized

[Qemu-devel] [PATCH v9 15/20] Add vhost-user as a vhost backend.

2014-03-04 Thread Antonios Motakis
a special handling in case of I/O failure - return -1 to indicate the upper layer that it failed. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-backend.c | 5 + hw/virtio/vhost-user.c| 356

Re: [Qemu-devel] [PATCH 0/5 v2] Provide common methods for exchange FD

2014-01-23 Thread Antonios Motakis
Hello, On Thu, Jan 23, 2014 at 9:27 AM, Lei Li wrote: > This patch series tries to refactor the functions used for > exchange of FD in current code, provide common methods > for it. > > I just tested it through page flipping migration, and tap/ > bridge-helper a bit, but have some environment p

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-27 Thread Antonios Motakis
Hello again, On Wed, Jan 15, 2014 at 3:49 PM, Michael S. Tsirkin wrote: > > On Wed, Jan 15, 2014 at 01:50:47PM +0100, Antonios Motakis wrote: > > > > > > > > On Wed, Jan 15, 2014 at 10:07 AM, Michael S. Tsirkin > > wrote: > > > > On Tue, Ja

Re: [Qemu-devel] [PATCH v6 0/8] Vhost and vhost-net support for userspace based backends

2014-01-29 Thread Antonios Motakis
Hello, On Mon, Jan 27, 2014 at 5:49 PM, Michael S. Tsirkin wrote: > > On Mon, Jan 27, 2014 at 05:37:02PM +0100, Antonios Motakis wrote: > > Hello again, > > > > > > On Wed, Jan 15, 2014 at 3:49 PM, Michael S. Tsirkin wrote: > > > > > > On Wed, Ja

[Qemu-devel] [PATCH v7 10/13] Add vhost-user as a vhost backend.

2014-01-31 Thread Antonios Motakis
global ram_list for ram blocks with a valid fd field set. This would be set when the -mem-path option with shared=on property is used. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-backend.c | 5 + hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v7 04/13] Add G_IO_HUP handler for socket chardev

2014-01-31 Thread Antonios Motakis
Close the chardev on receiving this event. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- qemu-char.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index c2e599e..1c34b2b 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2643,6

[Qemu-devel] [PATCH v7 11/13] Add new vhost-user netdev backend

2014-01-31 Thread Antonios Motakis
: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/net/vhost-user.h | 17 +++ net/Makefile.objs| 2 +- net/clients.h| 3 ++ net/vhost-user.c | 130 +++ 4 files changed, 151 insertions(+), 1 deletion(-) create

[Qemu-devel] [PATCH v7 09/13] Add vhost-backend and VhostBackendType

2014-01-31 Thread Antonios Motakis
Use vhost_set_backend_type to initialise a proper vhost_ops structure. In vhost_net_init and vhost_net_start_one call conditionally TAP related initialisation depending on the vhost backend type. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v7 07/13] vhost_net_init will use VhostNetOptions to get all its arguments

2014-01-31 Thread Antonios Motakis
pass the fd. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 24 +--- hw/scsi/vhost-scsi.c | 10 +- hw/virtio/vhost.c | 12 +++- include/hw/virtio/vhost.h | 2 +- include/net/vhost_net.h | 8

[Qemu-devel] [PATCH v7 03/13] Add chardev API qemu_chr_fe_set_msgfds

2014-01-31 Thread Antonios Motakis
This will set an array of file descriptors to the internal structures. The next time a message is send the array will be send as ancillary data. This feature works on unix domain socket backend only. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h

[Qemu-devel] [PATCH v7 05/13] vhost_net should call the poll callback only when it is set

2014-01-31 Thread Antonios Motakis
The poll callback needs to be called when bringing up or down the vhost_net instance. As it is not mandatory for an NetClient to implement it, invoke it only when it is set. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 13 ++--- 1 file

[Qemu-devel] [PATCH v7 13/13] Add vhost-user protocol documentation

2014-01-31 Thread Antonios Motakis
This document describes the basic message format used by vhost-user for communication over a unix domain socket. The protocol is based on the existing ioctl interface used for the kernel version of vhost. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- docs/specs/vhost

[Qemu-devel] [PATCH v7 00/13] Vhost and vhost-net support for userspace based backends

2014-01-31 Thread Antonios Motakis
d unlink properties - Set 1 sec timeout when read/write to the unix domain socket - Fix file descriptor leak Changes from v2: - Reconnect when the backend disappears Changes from v1: - Implementation of vhost-user netdev backend - Code improvements Antonios Motakis (13): Convert -me

[Qemu-devel] [PATCH v7 06/13] Refactor virtio-net to use a generic get_vhost_net

2014-01-31 Thread Antonios Motakis
This decouples virtio-net from the TAP netdev backend and allows support for other backends to be implemented. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 30 +++--- hw/net/virtio-net.c | 39

[Qemu-devel] [PATCH v7 08/13] Add vhost_ops to the vhost_dev struct and replace all relevant ioctls

2014-01-31 Thread Antonios Motakis
Decouple vhost from the Linux kernel by introducing vhost_ops. The intention is to provide different backends - 'kernel' backend based on the ioctl interface, and 'user' backend based on a unix domain socket and shared memory. Signed-off-by: Antonios Motakis Signed-off-

[Qemu-devel] [PATCH v7 12/13] Add the vhost-user netdev backend to command line

2014-01-31 Thread Antonios Motakis
-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hmp-commands.hx | 4 +-- hw/net/vhost_net.c | 4 +++ hw/net/virtio-net.c | 3 ++ net/hub.c | 1 + net/net.c | 2 ++ net/vhost-user.c| 91 +++-- qapi

[Qemu-devel] [PATCH v7 02/13] Add chardev API qemu_chr_fe_read_all

2014-01-31 Thread Antonios Motakis
This function will attempt to read data from the chardev trying to fill the buffer up to the given length. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- include/sysemu/char.h | 14 +++ qemu-char.c | 65

[Qemu-devel] [PATCH v7 01/13] Convert -mem-path to QemuOpts and add prealloc and share properties

2014-01-31 Thread Antonios Motakis
Extend -mem-path with additional properties: - prealloc=on|off - default off, same as -mem-prealloc - share=on|off - default off, memory is mmapped with MAP_SHARED flag Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- exec.c | 30

Re: [Qemu-devel] [PATCH v7 00/13] Vhost and vhost-net support for userspace based backends

2014-02-10 Thread Antonios Motakis
Hello, On Mon, Feb 10, 2014 at 9:57 AM, Michael S. Tsirkin wrote: > > On Fri, Jan 31, 2014 at 06:34:29PM +0100, Antonios Motakis wrote: > > In this patch series we would like to introduce our approach for putting a > > virtio-net backend in an external userspace process. Our

Re: [Qemu-devel] [PATCH v7 11/13] Add new vhost-user netdev backend

2014-02-10 Thread Antonios Motakis
On Mon, Feb 10, 2014 at 9:42 AM, Michael S. Tsirkin wrote: > On Fri, Jan 31, 2014 at 06:34:40PM +0100, Antonios Motakis wrote: >> Add a new QEMU netdev backend that is intended to invoke vhost_net with the >> vhost-user backend. >> >> At runtime the netdev will detect

[Qemu-devel] [RFC 0/5] Vhost and vhost-net support for userspace based backends

2013-11-29 Thread Antonios Motakis
the socket is not available - No reconnect when the backend disappears - Decouple vhost-net from the tap net backend when used with vhost-user Antonios Motakis (5): Decouple vhost from kernel interface Add vhost-kernel and the vhost-user skeleton Add vhostsock option Add domain socket

[Qemu-devel] [PATCH 4/5] Add domain socket communication for vhost-user backend

2013-11-29 Thread Antonios Motakis
SCM_RIGHTS type in the message control header. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/virtio/vhost-backend.c | 164 +- 1 file changed, 162 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost

[Qemu-devel] [PATCH 1/5] Decouple vhost from kernel interface

2013-11-29 Thread Antonios Motakis
nly in vhost-backend (ioctl, open, close). Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 8 +++ hw/scsi/vhost-scsi.c | 7 +++--- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-backend.c |

[Qemu-devel] [PATCH 2/5] Add vhost-kernel and the vhost-user skeleton

2013-11-29 Thread Antonios Motakis
Introduce the backend type - vhost-kernel and vhost-user. Add basic ioctl, open, close multiplexing depending on selected backend. Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c| 3 +-- hw/scsi/vhost-scsi.c | 4 ++-- hw

[Qemu-devel] [PATCH 3/5] Add vhostsock option

2013-11-29 Thread Antonios Motakis
-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- hw/net/vhost_net.c | 22 +- include/net/vhost_net.h | 5 - net/tap.c | 4 +++- qapi-schema.json| 3 +++ qemu-options.hx | 3 ++- 5 files changed, 29 insertions(+), 8 deletions

[Qemu-devel] [PATCH 5/5] Add vhost-user calls implementation

2013-11-29 Thread Antonios Motakis
fds array for inclusion in the sendmsd control header. VHOST_SET_MEM_TABLE ignores the supplied vhost_memory structure and scans the global ram_list for ram blocks wiht a valid fd field set. This would be set when -mem-path and -mem-prealloc command line options are used. Signed-off-by: Antonios

Re: [Qemu-devel] [RFC 0/5] Vhost and vhost-net support for userspace based backends

2013-12-04 Thread Antonios Motakis
On Wed, Dec 4, 2013 at 2:56 PM, Stefan Hajnoczi wrote: > On Fri, Nov 29, 2013 at 08:52:21PM +0100, Antonios Motakis wrote: > > In this patch series we would like to introduce our approach for putting > a > > virtio-net backend in an external userspace process. Our eventual targ

Re: [Qemu-devel] [PATCH 3/5] Add vhostsock option

2013-12-04 Thread Antonios Motakis
On Wed, Dec 4, 2013 at 2:42 PM, Stefan Hajnoczi wrote: > On Fri, Nov 29, 2013 at 08:52:24PM +0100, Antonios Motakis wrote: > > @@ -91,15 +91,27 @@ static int vhost_net_get_fd(NetClientState *backend) > > } > > } > > > > -struct vhost_net *vhost_net_init(N

Re: [Qemu-devel] [PATCH 2/5] Add vhost-kernel and the vhost-user skeleton

2013-12-04 Thread Antonios Motakis
On Wed, Dec 4, 2013 at 2:47 PM, Stefan Hajnoczi wrote: > On Fri, Nov 29, 2013 at 08:52:23PM +0100, Antonios Motakis wrote: > > diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c > > index 05de174..80defe4 100644 > > --- a/hw/virtio/vhost-backend.c >

  1   2   >