Re: [Qemu-devel] [PATCH 3/4] 9pfs: stat_to_qid: use device as input to qid.path

2018-02-16 Thread Antonios Motakis
On 02/09/2018 06:57 PM, Greg Kurz wrote: On Fri, 9 Feb 2018 10:06:05 -0600 Eric Blake wrote: On 02/09/2018 09:13 AM, Greg Kurz wrote: On Thu, 8 Feb 2018 19:00:18 +0100 wrote: From: Antonios Motakis To support multiple devices on the 9p share, and avoid qid path collisions we take

Re: [Qemu-devel] [PATCH 2/4] 9pfs: check for file device to avoid QID path collisions

2018-02-16 Thread Antonios Motakis
On 02/09/2018 02:03 PM, Greg Kurz wrote: On Thu, 8 Feb 2018 19:00:17 +0100 wrote: From: Antonios Motakis The QID path should uniquely identify a file. However, the inode of a file is currently used as the QID path, which on its own only uniquely identifies wiles within a device

Re: [Qemu-devel] [PATCH 1/4] 9pfs: V9fsQID: set type of version and path to unsigned

2018-02-16 Thread Antonios Motakis
On 02/09/2018 01:37 PM, Greg Kurz wrote: On Thu, 8 Feb 2018 19:00:16 +0100 wrote: From: Antonios Motakis There is no need for signedness on these QID fields for 9p. Signed-off-by: Antonios Motakis --- I agree these should be unsigned, but you have some more places to adapt to this

Re: [Qemu-devel] [PATCH 4/4] 9pfs: stat_to_qid: implement slow path

2018-02-16 Thread Antonios Motakis
On 02/09/2018 10:47 PM, Emilio G. Cota wrote: On Fri, Feb 09, 2018 at 16:22:33 +0100, Greg Kurz wrote: On Thu, 8 Feb 2018 19:00:19 +0100 wrote: (snip) /* stat_to_qid needs to map inode number (64 bits) and device id (32 bits) * to a unique QID path (64 bits). To avoid having to map and

Re: [Qemu-devel] [PATCH 3/4] 9pfs: stat_to_qid: use device as input to qid.path

2018-02-16 Thread Antonios Motakis
On 02/09/2018 10:58 PM, Emilio G. Cota wrote: On Fri, Feb 09, 2018 at 16:13:26 +0100, Greg Kurz wrote: On Thu, 8 Feb 2018 19:00:18 +0100 wrote: (snip) +/* creative abuse of tb_hash_func7, which is based on xxhash */ +static uint32_t qpp_hash(QppEntry e) +{ +return tb_hash_func7(e.ino_pr

Re: [Qemu-devel] [RFC] qid path collision issues in 9pfs

2018-01-24 Thread Antonios Motakis
On 01/24/2018 02:30 PM, Greg Kurz wrote: Thanks Emilio for providing these valuable suggestions ! :) On Sat, 20 Jan 2018 17:03:49 -0500 "Emilio G. Cota" wrote: On Fri, Jan 19, 2018 at 19:05:06 -0500, Emilio G. Cota wrote: On Fri, 12 Jan 2018 19:32:10 +0800 Antonios Motakis wro

Re: [Qemu-devel] [RFC] qid path collision issues in 9pfs

2018-01-14 Thread Antonios Motakis
On 13-Jan-18 00:14, Greg Kurz wrote: > On Fri, 12 Jan 2018 19:32:10 +0800 > Antonios Motakis wrote: > >> Hello all, >> > > Hi Antonios, > > I see you have attached a patch to this email... this really isn't the > preferred > way to do things sinc

[Qemu-devel] [RFC] qid path collision issues in 9pfs

2018-01-12 Thread Antonios Motakis
ay to eliminate these issues completely. This is the extent that we were able to analyze the issue from our side, we would like to hear if there are some better ideas, or which approach would be more appropriate for upstream. Best regards, -- Antonios Motakis Virtualization Engineer Huawei Technol

Re: [Qemu-devel] [RFC 4/4] MemoryRegion with EOI callbacks for VFIO Platform devices

2014-04-25 Thread Antonios Motakis
; > >> @@ -380,7 +492,7 @@ static int vfio_mmap_region(VFIODevice *vdev, > VFIORegion *region, > >> goto error; > >> } > >> > >> -memory_region_init_ram_ptr(submem, OBJECT(vdev), name, size, > *map); > >> + m

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

2014-03-05 Thread Antonios Motakis
On Tue, Mar 4, 2014 at 7:38 PM, Michael S. Tsirkin wrote: > On Tue, Mar 04, 2014 at 07:22:56PM +0100, Antonios Motakis wrote: > > This will be used in a following patch to ensure that a vhost-user > > client reconnecting to QEMU supports the features that were exposed > >

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

2014-03-05 Thread Antonios Motakis
Hello Andreas, On Tue, Mar 4, 2014 at 7:39 PM, Andreas Färber wrote: > Am 04.03.2014 19:23, schrieb Antonios Motakis: > > This test creates a 'server' chardev to listen for vhost-user messages. > > Once VHOST_USER_SET_MEM_TABLE is received it mmaps each received regi

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

2014-03-05 Thread Antonios Motakis
Hello, On Tue, Mar 4, 2014 at 7:45 PM, Michael S. Tsirkin wrote: > On Tue, Mar 04, 2014 at 07:22:53PM +0100, Antonios Motakis wrote: > > On stopping the vhost, a call to VHOST_GET_VRING_BASE is issued. The > > received value is stored as last_avail_idx, so the virtque

[Qemu-devel] [PATCH v9 01/20] Convert -mem-path to QemuOpts and add share property

2014-03-04 Thread Antonios Motakis
Extend -mem-path with additional property: - share=on|off - default off, memory is mmapped with MAP_SHARED flag Signed-off-by: Antonios Motakis Signed-off-by: Nikolay Nikolaev --- exec.c | 21 +++-- include/exec/cpu-all.h | 1 - qemu-options.hx| 8

[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

[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 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 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 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 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):

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 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

[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 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 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 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 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 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 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 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 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 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 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

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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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

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

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

[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

[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 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 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 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 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 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 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 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 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 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 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

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

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 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-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

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-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-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 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 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 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 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

[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

[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 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 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 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 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 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

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. >> >>

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 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 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 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 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

[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

[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 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 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

  1   2   >