Skip to contentSkip to conversation

backend: multi-client-socket

PATCH In review Baptiste Reynal 2 participants 3 messages Mar 18, 2016 – Apr 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backend: multi-client-socket

This patch introduces a new socket for QEMU, called multi-client-socket. This socket allows multiple QEMU instances to communicate by sharing messages and file descriptors.

A socket can be instantiated with the following parameters:
-object multi-socket-backend,id=<id>,path=<socket_path>,listen=<on/off>

If listen is set, the socket will act as a listener and register new clients.

This patch is a follow-up to "[RFC PATCH 0/8] Towards an Heterogeneous QEMU":
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg00171.html

This work has been sponsored by Huawei Technologies Duesseldorf GmbH.

---
 backends/Makefile.objs      |   2 +
 backends/multi-socket.c     | 355 ++++++++++++++++++++++++++++++++++++++++++++
 include/qemu/multi-socket.h | 124 ++++++++++++++++
 3 files changed, 481 insertions(+)
 create mode 100644 backends/multi-socket.c
 create mode 100644 include/qemu/multi-socket.h
backends/Makefile.objs +2 -0
index 31a3a89..689eac3 100644
@@ -9,3 +9,5 @@ common-obj-$(CONFIG_TPM) += tpm.o
 
 common-obj-y += hostmem.o hostmem-ram.o
 common-obj-$(CONFIG_LINUX) += hostmem-file.o
+
+common-obj-y += multi-socket.o
backends/multi-socket.c new file +355 -0

355 lines not on this page · raw message

include/qemu/multi-socket.h new file +124 -0

124 lines not on this page · raw message

Signature · 1 line
2.7.3
#1 lore raw
Quoted 15 lines · Baptiste Reynal

This patch introduces a new socket for QEMU, called multi-client-socket. This socket allows multiple QEMU instances to communicate by sharing messages and file descriptors.

A socket can be instantiated with the following parameters:
-object multi-socket-backend,id=<id>,path=<socket_path>,listen=<on/off>

If listen is set, the socket will act as a listener and register new clients.

This patch is a follow-up to "[RFC PATCH 0/8] Towards an Heterogeneous QEMU":
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg00171.html

This work has been sponsored by Huawei Technologies Duesseldorf GmbH.

Quoted 8 lines
---
 backends/Makefile.objs      |   2 +
 backends/multi-socket.c     | 355 ++++++++++++++++++++++++++++++++++++++++++++
 include/qemu/multi-socket.h | 124 ++++++++++++++++
 3 files changed, 481 insertions(+)
 create mode 100644 backends/multi-socket.c
 create mode 100644 include/qemu/multi-socket.h

Is it possible to reuse QEMU's UNIX domain socket and fd passing code? For example, take a look at io/channel-socket.c.

#2 lore raw

I wasn't aware of this new framework when I started the development of this socket. For sure I'll have a deeper look and see what can be shared for the next version.

Quoted 27 lines · Stefan Hajnoczi
Quoted 15 lines · Baptiste Reynal

This patch introduces a new socket for QEMU, called multi-client-socket. This socket allows multiple QEMU instances to communicate by sharing messages and file descriptors.

A socket can be instantiated with the following parameters:
-object multi-socket-backend,id=<id>,path=<socket_path>,listen=<on/off>

If listen is set, the socket will act as a listener and register new clients.

This patch is a follow-up to "[RFC PATCH 0/8] Towards an Heterogeneous QEMU":
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg00171.html

This work has been sponsored by Huawei Technologies Duesseldorf GmbH.

Quoted 8 lines
---
 backends/Makefile.objs      |   2 +
 backends/multi-socket.c     | 355 ++++++++++++++++++++++++++++++++++++++++++++
 include/qemu/multi-socket.h | 124 ++++++++++++++++
 3 files changed, 481 insertions(+)
 create mode 100644 backends/multi-socket.c
 create mode 100644 include/qemu/multi-socket.h

Is it possible to reuse QEMU's UNIX domain socket and fd passing code? For example, take a look at io/channel-socket.c.