Skip to content

Add qemu-storage-daemon

Kevin Wolf qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 4 repliesIn review
  2. v1 RFC18 patches 46 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20qemu-storage-daemon: Add barebone toolMakefile configure qemu-storage-daemon.c+129 -10 replies
2/20stubs: Add arch_typeinclude/sysemu/arch_init.h stubs/Makefile.objs stubs/arch_type.c+7 -00 replies
3/20block: Move system emulator QMP commands to block/qapi-sysemu.cblock/Makefile.objs block/qapi-sysemu.c blockdev.c+592 -5590 replies
4/20block: Move common QMP commands to block-core QAPI moduleqapi/block-core.json qapi/block.json+283 -2840 replies
5/20block: Move sysemu QMP commands to QAPI block modulemonitor/qmp-cmds.c qapi/block-core.json qapi/block.json+387 -3870 replies
6/20qemu-storage-daemon: Add --blockdev optionMakefile Makefile.objs block/Makefile.objs +1 more+43 -20 replies
7/20qapi: Flatten object-addhw/block/xen-block.c include/qom/object_interfaces.h monitor/misc.c +3 more+67 -110 replies
8/20qemu-storage-daemon: Add --object optionMakefile.objs qemu-storage-daemon.c qom/Makefile.objs+49 -12 replies
9/20qemu-storage-daemon: Add --nbd-server optionMakefile.objs blockdev-nbd.c include/block/nbd.h +2 more+56 -20 replies
10/20blockdev-nbd: Boxed argument type for nbd-server-addblockdev-nbd.c monitor/hmp-cmds.c qapi/block-core.json+47 -270 replies
11/20qemu-storage-daemon: Add --export optionqapi/block-core.json qemu-storage-daemon.c+58 -00 replies
12/20qemu-storage-daemon: Add main loopMakefile.objs qemu-storage-daemon.c+15 -00 replies
13/20qemu-storage-daemon: Add --chardev optionMakefile qemu-storage-daemon.c+25 -10 replies
14/20stubs: Update monitor stubs for qemu-storage-daemonstubs/Makefile.objs stubs/monitor-core.c stubs/monitor.c+24 -130 replies
15/20qapi: Create 'pragma' moduleqapi/Makefile.objs qapi/pragma.json qapi/qapi-schema.json+26 -250 replies
16/20monitor: Create QAPIfied monitor_init()include/monitor/monitor.h monitor/monitor.c qapi/control.json+80 -350 replies
17/20qmp: Fail gracefully if chardev is already in useinclude/monitor/monitor.h monitor/monitor.c monitor/qmp.c +2 more+16 -80 replies
18/20hmp: Fail gracefully if chardev is already in usechardev/char.c gdbstub.c include/monitor/monitor.h +4 more+18 -80 replies
19/20monitor: Add allow_hmp parameter to monitor_init()include/monitor/monitor.h monitor/monitor.c qapi/control.json+13 -40 replies
20/20qemu-storage-daemon: Add --monitor optionMakefile Makefile.objs monitor/Makefile.objs +7 more+121 -50 replies

Reviews trailers per patch

None of the 20 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStefan Hajnoczi
SeriesA-b
1/20
2/20
3/20
4/20
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/20] Add qemu-storage-daemon

This series adds a new tool 'qemu-storage-daemon', which can be used to export and perform operations on block devices. There is some overlap between qemu-img/qemu-nbd and the new qemu-storage-daemon, but there are a few important differences:

* The qemu-storage-daemon has QMP support. The command set is obviously restricted compared to the system emulator because there is no guest, but all of the block operations that are not tied to gues devices are present.

This means that it can access advanced options or operations that the qemu-img command line doesn't expose. For example, blockdev-create is a lot more powerful than 'qemu-img create', and qemu-storage-daemon allows to execute it without starting a guest.

Compared to qemu-nbd it means that, for example, block jobs can now be executed on the server side, and backing chains shared by multiple VMs can be modified this way.

* The existing tools all have a separately invented one-off syntax for the job at hand, which usually comes with restrictions compared to the system emulator. qemu-storage-daemon shares the same syntax with the system emulator for most options and prefers QAPI based interfaces where possible (such as --blockdev), so it should be easy to make use of in libvirt.

The exception is --chardev, for which not clear design for a QAPIfied command line exists yet. We'll consider this interface unstable until we've figured out how to solve it. For now it just uses the same QemuOpts-based code as the system emulator.

* While this series implements only NBD exports, the storage daemon is intended to serve multiple protocols and its syntax reflects this. In the past, we had proposals to add new one-off tools for exporting over new protocols like FUSE or TCMU.

With a generic storage daemon, additional export methods have a home without adding a new tool for each of them.

The plan is to merge qemu-storage-daemon as an experimental feature with a reduced API stability promise in 5.0.

Kevin Wolf (20):
qemu-storage-daemon: Add barebone tool
stubs: Add arch_type
block: Move system emulator QMP commands to block/qapi-sysemu.c
block: Move common QMP commands to block-core QAPI module
block: Move sysemu QMP commands to QAPI block module
qemu-storage-daemon: Add --blockdev option
qapi: Flatten object-add
qemu-storage-daemon: Add --object option
qemu-storage-daemon: Add --nbd-server option
blockdev-nbd: Boxed argument type for nbd-server-add
qemu-storage-daemon: Add --export option
qemu-storage-daemon: Add main loop
qemu-storage-daemon: Add --chardev option
stubs: Update monitor stubs for qemu-storage-daemon
qapi: Create 'pragma' module
monitor: Create QAPIfied monitor_init()
qmp: Fail gracefully if chardev is already in use
hmp: Fail gracefully if chardev is already in use
monitor: Add allow_hmp parameter to monitor_init()
qemu-storage-daemon: Add --monitor option

 qapi/block-core.json                 | 730 +++++++++++++--------------
 qapi/block.json                      | 512 +++++++++++--------
 qapi/control.json                    |  37 ++
 qapi/pragma.json                     |  24 +
 qapi/qapi-schema.json                |  25 +-
 qapi/qom.json                        |  12 +-
 qapi/transaction.json                |   2 +-
 configure                            |   2 +-
 include/block/nbd.h                  |   1 +
 include/monitor/monitor.h            |   6 +-
 include/qom/object_interfaces.h      |   7 +
 include/sysemu/arch_init.h           |   2 +
 block/qapi-sysemu.c                  | 590 ++++++++++++++++++++++
 blockdev-nbd.c                       |  40 +-
 blockdev.c                           | 559 --------------------
 chardev/char.c                       |   8 +-
 gdbstub.c                            |   2 +-
 hw/block/xen-block.c                 |  11 +-
 monitor/hmp-cmds.c                   |  21 +-
 monitor/hmp.c                        |   8 +-
 monitor/misc.c                       |   2 +
 monitor/monitor.c                    |  86 ++--
 monitor/qmp-cmds.c                   |   2 +-
 monitor/qmp.c                        |  11 +-
 qemu-storage-daemon.c                | 340 +++++++++++++
 qom/qom-qmp-cmds.c                   |  42 +-
 stubs/arch_type.c                    |   4 +
 stubs/monitor-core.c                 |  21 +
 stubs/monitor.c                      |  17 +-
 tests/test-util-sockets.c            |   4 +-
 scripts/qapi/gen.py                  |   5 +
 Makefile                             |  37 ++
 Makefile.objs                        |   9 +
 block/Makefile.objs                  |   4 +-
 monitor/Makefile.objs                |   2 +
 qapi/Makefile.objs                   |   7 +-
 qemu-deprecated.texi                 |   4 +
 qom/Makefile.objs                    |   1 +
 storage-daemon/Makefile.objs         |   1 +
 storage-daemon/qapi/Makefile.objs    |   1 +
 storage-daemon/qapi/qapi-schema.json |  26 +
 stubs/Makefile.objs                  |   2 +
 42 files changed, 1955 insertions(+), 1272 deletions(-)
 create mode 100644 qapi/pragma.json
 create mode 100644 block/qapi-sysemu.c
 create mode 100644 qemu-storage-daemon.c
 create mode 100644 stubs/arch_type.c
 create mode 100644 stubs/monitor-core.c
 create mode 100644 storage-daemon/Makefile.objs
 create mode 100644 storage-daemon/qapi/Makefile.objs
 create mode 100644 storage-daemon/qapi/qapi-schema.json
Signature · 1 line
2.20.1