From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com,
coiby.xu@gmail.com, mreitz@redhat.com, stefanha@redhat.com
Subject: [PATCH v2 00/20] Add qemu-storage-daemon
Date: Mon, 24 Feb 2020 15:29:48 +0100 [thread overview]
Message-ID: <20200224143008.13362-1-kwolf@redhat.com> (raw)
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
--
2.20.1
next reply other threads:[~2020-02-24 14:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 14:29 Kevin Wolf [this message]
2020-02-24 14:29 ` [PATCH v2 01/20] qemu-storage-daemon: Add barebone tool Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 02/20] stubs: Add arch_type Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 03/20] block: Move system emulator QMP commands to block/qapi-sysemu.c Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 04/20] block: Move common QMP commands to block-core QAPI module Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 05/20] block: Move sysemu QMP commands to QAPI block module Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 06/20] qemu-storage-daemon: Add --blockdev option Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 07/20] qapi: Flatten object-add Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 08/20] qemu-storage-daemon: Add --object option Kevin Wolf
2020-04-16 5:20 ` Coiby Xu
2020-06-09 23:25 ` Coiby Xu
2020-02-24 14:29 ` [PATCH v2 09/20] qemu-storage-daemon: Add --nbd-server option Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 10/20] blockdev-nbd: Boxed argument type for nbd-server-add Kevin Wolf
2020-02-24 14:29 ` [PATCH v2 11/20] qemu-storage-daemon: Add --export option Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 12/20] qemu-storage-daemon: Add main loop Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 13/20] qemu-storage-daemon: Add --chardev option Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 14/20] stubs: Update monitor stubs for qemu-storage-daemon Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 15/20] qapi: Create 'pragma' module Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 16/20] monitor: Create QAPIfied monitor_init() Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 17/20] qmp: Fail gracefully if chardev is already in use Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 18/20] hmp: " Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 19/20] monitor: Add allow_hmp parameter to monitor_init() Kevin Wolf
2020-02-24 14:30 ` [PATCH v2 20/20] qemu-storage-daemon: Add --monitor option Kevin Wolf
2020-02-24 15:34 ` [PATCH v2 00/20] Add qemu-storage-daemon no-reply
2020-02-28 11:16 ` Stefan Hajnoczi
2020-03-03 17:00 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200224143008.13362-1-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=coiby.xu@gmail.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).