mbox series

[RFC,v2,00/35] Initial support of multi-process qemu

Message ID 20190617181450.29092-1-elena.ufimtseva@oracle.com (mailing list archive)
Headers show
Series Initial support of multi-process qemu | expand

Message

Elena Ufimtseva June 17, 2019, 6:14 p.m. UTC
From: Elena Ufimtseva <elena.ufimtseva@oracle.com>

Initial support of multi-process qemu

Started with the presentation in October 2017 made by
Marc-Andre (Red Hat) and Konrad Wilk (Oracle)
(http://events17.linuxfoundation.org/sites/events/files/slides/KVM%20FORUM%20multi-process.pdf,
https://www.youtube.com/watch?v=Kq1-coHh7lg) and
continued in the BoF session at the KVM forum in 2018 with Jag leading
the discussion, the multi-process project is now in the prototype version
and presented by this patchset.

The proof of the concept patches were posted on the qemu-devel mailing
list before the BoF session at the KVM forum and can be found here:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg566538.html

This series presents the initial support for QEMU that can
launch some of the devices in the remote processes.

Thanks to a v1 review and some of the question Stefan and Daniel asked, we
were able to incorporate your ideas into our goals.

We would like to present version 2 of the patchset.
This version has addressed comments made during the review of v1 and includes:

- support for libvirt fork/exec of remote processes;
  QEMU is still capable of fork/execing the remote processes unless its disabled
  by seccomp.
  When using libvirt, the daemon will spawn remote processes and pass the communication
  file descriptors to main QEMU process and the remote processes.
  The libvirt patches are in the making and will be sent out shortly;
- using existing -device/-drive command line options to specify remote devices with
  additional suboptons;
- refractor message sending code;
- remove specific HMP/QMP commands and use the one that exist now;
- extend existing QMP commands;
- added timeout to communication channel;

Following people contributed to this patchset:

John G Johnson <john.g.johnson@oracle.com>
Jagannathan Raman <jag.raman@oracle.com>
Elena Ufimtseva <elena.ufimtseva@oracle.com>
Kanth Ghatraju <kanth.ghatraju@oracle.com>

For full concept writeup about QEMU disaggregation refer to
docs/devel/qemu-multiprocess.txt.

This series has a limited scope and allows QEMU to launch
LSI SCSI controller emulation in the separate process and
execute HMP commands to manipulate the devices.
This series with appropriate libvirt patches allows to
launch a guest with remote processes using libvirt.
(libvirt patches will be posted and will be reflected in the reply to
this patch).

Please refer to the docs/qemu-multiprocess.txt for usage
information.

his series is based on qemu upstream commit
3284aa128153750f14a61e8a96fd085e6f2999b6.

TODO items:
  - bus support for remote process (non-default);
  - live migration;
  - performance improvements;
  - support for more devices;
  - support for seccomp for remote processes;
  - support for CPU disaggregated emulation;

We would like to welcome all your ideas, concerns and questions
for this patchset.

Thank you!

Elena Ufimtseva (13):
  multi-process: add a command line option for debug file
  multi-process: introduce proxy object
  multi-process: store info about the remote process
  multi-process: configure remote side devices
  multi-process: add qdev_proxy_add to create proxy devices
  multi-process: remote: add setup_devices and setup_drive msg
    processing
  multi-process: remote: use fd for socket from parent process
  multi-process: remote: add create_done condition
  multi-process: add processing of remote drive and device command line
  multi-process: add heartbeat timer and signal handler
  multi-process: handle heartbit messages in remote process
  multi-process: add the concept description to
    docs/devel/qemu-multiprocess
  multi-process: add configure and usage information

Jagannathan Raman (22):
  multi-process: memory: alloc RAM from file at offset
  multi-process: util: Add qemu_thread_cancel() to cancel running thread
  multi-process: Add stub functions to facilate build of multi-process
  multi-process: Add config option for multi-process QEMU
  multi-process: build system for remote device process
  multi-process: define proxy-link object
  multi-process: add functions to synchronize proxy and remote endpoints
  multi-process: setup PCI host bridge for remote device
  multi-process: setup a machine object for remote device process
  multi-process: setup memory manager for remote device
  multi-process: remote process initialization
  multi-process: PCI BAR write handling for proxy & remote endpoints
  multi-process: PCI BAR read handling for proxy & remote endpoints
  multi-process: Add LSI device proxy object
  multi-process: Synchronize remote memory
  multi-process: create IOHUB object to handle irq
  multi-process: Add QMP & extend HMP commands to list remote info
  multi-process: Extend monitor commands to add a device to remote
    process
  multi-process: Extend monitor commands to remove device from remote
    process
  multi-process: Extend drive_add to add drive to remote device
  multi-process: Extend drive_del command to delete drive from remote
    process
  multi-process: Extend block_resize command to support remote block
    device

 Makefile                            |    5 +-
 Makefile.objs                       |   22 +
 Makefile.target                     |   55 +-
 accel/stubs/kvm-stub.c              |    5 +
 accel/stubs/tcg-stub.c              |   85 ++
 backends/Makefile.objs              |    2 +
 block/Makefile.objs                 |    2 +
 blockdev.c                          |   24 +
 configure                           |   11 +
 device-hotplug.c                    |    7 +
 docs/devel/qemu-multiprocess.txt    | 1137 +++++++++++++++++++++++++++
 docs/qemu-multiprocess.txt          |   59 ++
 exec.c                              |   12 +-
 hmp-commands-info.hx                |   16 +
 hmp-commands.hx                     |    9 +-
 hmp.c                               |   25 +
 hmp.h                               |    2 +
 hw/Makefile.objs                    |    9 +
 hw/block/Makefile.objs              |    2 +
 hw/core/Makefile.objs               |   14 +
 hw/core/machine.c                   |   12 +
 hw/nvram/Makefile.objs              |    2 +
 hw/pci/Makefile.objs                |    4 +
 hw/proxy/Makefile.objs              |    3 +
 hw/proxy/memory-sync.c              |  214 +++++
 hw/proxy/monitor.c                  |  296 +++++++
 hw/proxy/proxy-lsi53c895a.c         |  162 ++++
 hw/proxy/qemu-proxy.c               |  509 ++++++++++++
 hw/scsi/Makefile.objs               |    2 +
 include/exec/address-spaces.h       |    2 +
 include/exec/ram_addr.h             |    2 +-
 include/glib-compat.h               |    4 +
 include/hw/boards.h                 |    4 +
 include/hw/pci/pci_ids.h            |    3 +
 include/hw/proxy/memory-sync.h      |   51 ++
 include/hw/proxy/proxy-lsi53c895a.h |   42 +
 include/hw/proxy/qemu-proxy.h       |  101 +++
 include/hw/qdev-core.h              |    1 +
 include/io/proxy-link.h             |  189 +++++
 include/monitor/qdev.h              |    8 +
 include/qemu/log.h                  |    1 +
 include/qemu/mmap-alloc.h           |    2 +-
 include/qemu/thread.h               |    1 +
 include/remote/iohub.h              |   63 ++
 include/remote/machine.h            |   48 ++
 include/remote/memory.h             |   34 +
 include/remote/pcihost.h            |   58 ++
 include/sysemu/blockdev.h           |    5 +
 include/sysemu/sysemu.h             |    1 +
 io/Makefile.objs                    |    2 +
 io/proxy-link.c                     |  317 ++++++++
 memory.c                            |    2 +-
 migration/Makefile.objs             |    2 +
 qapi/block-core.json                |   29 +
 qdev-monitor.c                      |  188 ++++-
 qom/Makefile.objs                   |    4 +
 remote/Makefile.objs                |    4 +
 remote/iohub.c                      |  159 ++++
 remote/machine.c                    |  141 ++++
 remote/memory.c                     |   98 +++
 remote/pcihost.c                    |   84 ++
 remote/remote-main.c                |  582 ++++++++++++++
 stubs/machine-init-done.c           |    4 +
 stubs/monitor.c                     |   41 +
 stubs/net-stub.c                    |   31 +
 stubs/replay.c                      |   14 +
 stubs/vl-stub.c                     |   75 ++
 stubs/vmstate.c                     |   20 +
 stubs/xen-mapcache.c                |   22 +
 util/log.c                          |    2 +
 util/mmap-alloc.c                   |    5 +-
 util/oslib-posix.c                  |    2 +-
 util/qemu-thread-posix.c            |   10 +
 vl.c                                |   68 +-
 74 files changed, 5211 insertions(+), 22 deletions(-)
 create mode 100644 docs/devel/qemu-multiprocess.txt
 create mode 100644 docs/qemu-multiprocess.txt
 create mode 100644 hw/proxy/Makefile.objs
 create mode 100644 hw/proxy/memory-sync.c
 create mode 100644 hw/proxy/monitor.c
 create mode 100644 hw/proxy/proxy-lsi53c895a.c
 create mode 100644 hw/proxy/qemu-proxy.c
 create mode 100644 include/hw/proxy/memory-sync.h
 create mode 100644 include/hw/proxy/proxy-lsi53c895a.h
 create mode 100644 include/hw/proxy/qemu-proxy.h
 create mode 100644 include/io/proxy-link.h
 create mode 100644 include/remote/iohub.h
 create mode 100644 include/remote/machine.h
 create mode 100644 include/remote/memory.h
 create mode 100644 include/remote/pcihost.h
 create mode 100644 io/proxy-link.c
 create mode 100644 remote/Makefile.objs
 create mode 100644 remote/iohub.c
 create mode 100644 remote/machine.c
 create mode 100644 remote/memory.c
 create mode 100644 remote/pcihost.c
 create mode 100644 remote/remote-main.c
 create mode 100644 stubs/net-stub.c
 create mode 100644 stubs/vl-stub.c
 create mode 100644 stubs/xen-mapcache.c

Comments

Daniel P. Berrangé June 18, 2019, 8:54 a.m. UTC | #1
On Mon, Jun 17, 2019 at 11:14:50AM -0700, elena.ufimtseva@oracle.com wrote:
> From: Elena Ufimtseva <elena.ufimtseva@oracle.com>
> 
> Initial support of multi-process qemu
> 
> Started with the presentation in October 2017 made by
> Marc-Andre (Red Hat) and Konrad Wilk (Oracle)
> (http://events17.linuxfoundation.org/sites/events/files/slides/KVM%20FORUM%20multi-process.pdf,
> https://www.youtube.com/watch?v=Kq1-coHh7lg) and
> continued in the BoF session at the KVM forum in 2018 with Jag leading
> the discussion, the multi-process project is now in the prototype version
> and presented by this patchset.
> 
> The proof of the concept patches were posted on the qemu-devel mailing
> list before the BoF session at the KVM forum and can be found here:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg566538.html
> 
> This series presents the initial support for QEMU that can
> launch some of the devices in the remote processes.
> 
> Thanks to a v1 review and some of the question Stefan and Daniel asked, we
> were able to incorporate your ideas into our goals.
> 
> We would like to present version 2 of the patchset.
> This version has addressed comments made during the review of v1 and includes:
> 
> - support for libvirt fork/exec of remote processes;
>   QEMU is still capable of fork/execing the remote processes unless its disabled
>   by seccomp.
>   When using libvirt, the daemon will spawn remote processes and pass the communication
>   file descriptors to main QEMU process and the remote processes.
>   The libvirt patches are in the making and will be sent out shortly;
> - using existing -device/-drive command line options to specify remote devices with
>   additional suboptons;
> - refractor message sending code;
> - remove specific HMP/QMP commands and use the one that exist now;
> - extend existing QMP commands;
> - added timeout to communication channel;
> 
> Following people contributed to this patchset:
> 
> John G Johnson <john.g.johnson@oracle.com>
> Jagannathan Raman <jag.raman@oracle.com>
> Elena Ufimtseva <elena.ufimtseva@oracle.com>
> Kanth Ghatraju <kanth.ghatraju@oracle.com>
> 
> For full concept writeup about QEMU disaggregation refer to
> docs/devel/qemu-multiprocess.txt.
> 
> This series has a limited scope and allows QEMU to launch
> LSI SCSI controller emulation in the separate process and
> execute HMP commands to manipulate the devices.
> This series with appropriate libvirt patches allows to
> launch a guest with remote processes using libvirt.
> (libvirt patches will be posted and will be reflected in the reply to
> this patch).
> 
> Please refer to the docs/qemu-multiprocess.txt for usage
> information.
> 
> his series is based on qemu upstream commit
> 3284aa128153750f14a61e8a96fd085e6f2999b6.
> 
> TODO items:
>   - bus support for remote process (non-default);
>   - live migration;
>   - performance improvements;
>   - support for more devices;
>   - support for seccomp for remote processes;
>   - support for CPU disaggregated emulation;
> 
> We would like to welcome all your ideas, concerns and questions
> for this patchset.

For future versions please make sure the mails sent a fully
threaded, so that all the patches are in-reply-to the cover
letter mail, rather than each scattered as a standalone mail.

The best way todo this is to use the excellent "git-publish"
tool. The added benefit of git-publish is that it will CC
all the subsystem maintainers whose code is touched

  https://github.com/stefanha/git-publish

It is packaged in Debian, Ubuntu, Fedora & EPEL

Regards,
Daniel