From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: mreitz@redhat.com, pkrempa@redhat.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org, armbru@redhat.com
Subject: Re: [RFC PATCH 00/18] Add qemu-storage-daemon
Date: Thu, 7 Nov 2019 10:33:57 +0000 [thread overview]
Message-ID: <20191107103357.GB120292@redhat.com> (raw)
In-Reply-To: <20191017130204.16131-1-kwolf@redhat.com>
On Thu, Oct 17, 2019 at 03:01:46PM +0200, Kevin Wolf wrote:
> 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 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.
>
> * 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.
>
> I'm posting this as an RFC mainly for two reasons:
>
> 1. The monitor integration, which could be argued to be a little hackish
> (some generated QAPI source files are built from a separate QAPI
> schema, but the per-module ones are taken from the system emulator)
> and Markus will want to have a closer look there. But from the IRC
> discussions we had, we seem to agree on the general approach here.
>
> 2. I'm not completely sure if the command line syntax is the final
> version that we want to support long-term. Many options directly use
> QAPI visitors (--blockdev, --export, --nbd-server) and should be
> fine. However, others use QemuOpts (--chardev, --monitor, --object).
>
> This is the same as in the system emulator, so we wouldn't be adding
> a new problem, but as there was talk about QAPIfying the command
> line, and I wouldn't want later syntax changes or adding lots of
> compatibility code to a new tool, I thought we should probably
> discuss whether QAPIfying from the start would be an option.
I think that following what the QEMU emulators currently do for
CLI args should be an explicit anti-goal, because we know that it is
a long standing source of pain. Fixing it in the emulator binaries
is hard due to backward compatibility, but for this new binary we
have a clean slate.
This feels like a good opportunity to implement & demonstrate what
we think QEMU configuration ought to look like. Work done for this
in the qemu-storage-daemon may well help us understand how we'll
be able to move the QEMU emulators into a new scheme later.
My personal wish would be to have no use of QemuOpts at all.
Use GOptionContext *only* for parsing command line arguments
related to execution of the daemon - ie things like --help,
--version, --daemon, --pid-file.
The use a "--config /path/to/json/file" arg to point to the config
file for everything else using QAPI schema to describe it fully.
When loading the config file, things should be created in order
in which they are specified. ie don't try and group things,
otherwise we end up back with the horrific hacks for objects
where some are created early & some late.
For an ambitious stretch goal, I think we should seriously consider
whether our use of chardevs is appropriate in all cases that exist,
and whether we can avoid the trap of over-using chardev in the new
storage daemon since it is a clean slate in terms of user facing
CLI config.
chardevs are designed for & reasonably well suited to attaching to
devices like serial ports, parallel ports, etc. You have a 1:1
remote:local peer relationship. The transport is a dumb byte
stream, nothing special needed on top & the user can cope with
any type of chardev.
Many cases where we've used chardevs as a backend in QEMU are a
poor fit. We just used chardevs as an "easy" way to configure a
UNIX or TCP socket from the CLI, and don't care about, nor work
with, any othuer chardev backends. As a result of this misuse
we've had to put in an increasing number of hacks in the chardev
code to deal with fact that callers want to know about & use
socket semantics. eg FD passing, the chardev reconnection polling
code.
The monitor is a prime example of a bad fit - it would be better
suited by simply referencing a SocketAddress QAPI type, instead
of having the chardev indirection. It would then directly use
the QIOChannelSocket APIs and avoid the inconvenient chardev
abstractions which are a source of complexity & instability for
no net gain. vhostuser is another prime example, responsible
for much of the complexity & bugs recently added to chardevs
to expose socket semantics
This is a long winded way of saying that we should consider what
syntax we expose for the monitor socket configuration with the
new daemon. Even if the internal code still uses a chardev for
the forseeable future, we have the option to hide this from the
user facing configuration. Let the user specify a SocketAddress,
which we use to secretly instantiate a chardev. Eventually we can
convert the monitor code to stop using a chardev internally too,
with a suitable deprecation period for main QEMU binarijes.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2019-11-07 10:36 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 13:01 [RFC PATCH 00/18] Add qemu-storage-daemon Kevin Wolf
2019-10-17 13:01 ` [RFC PATCH 01/18] qemu-storage-daemon: Add barebone tool Kevin Wolf
2019-10-24 13:50 ` Eric Blake
2019-11-13 14:12 ` Kevin Wolf
2019-11-06 12:11 ` Max Reitz
2019-11-07 16:21 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 02/18] qemu-storage-daemon: Add --object option Kevin Wolf
2019-11-07 20:36 ` Markus Armbruster
2019-11-14 12:05 ` Kevin Wolf
2019-11-18 9:10 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 03/18] stubs: Add arch_type Kevin Wolf
2019-10-17 13:01 ` [RFC PATCH 04/18] stubs: Add blk_by_qdev_id() Kevin Wolf
2019-11-08 9:03 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 05/18] qemu-storage-daemon: Add --blockdev option Kevin Wolf
2019-11-08 13:29 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 06/18] qemu-storage-daemon: Add --nbd-server option Kevin Wolf
2019-11-06 12:51 ` Max Reitz
2019-11-06 19:25 ` Eric Blake
2019-11-07 8:33 ` Kevin Wolf
2019-11-07 13:45 ` Eric Blake
2019-11-07 15:27 ` Kevin Wolf
2019-11-07 15:36 ` Eric Blake
2019-11-08 15:36 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 07/18] blockdev-nbd: Boxed argument type for nbd-server-add Kevin Wolf
2019-10-17 13:01 ` [RFC PATCH 08/18] qemu-storage-daemon: Add --export option Kevin Wolf
2019-11-06 13:11 ` Max Reitz
2019-11-06 13:34 ` Kevin Wolf
2019-11-06 13:39 ` Max Reitz
2019-11-08 15:57 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 09/18] qemu-storage-daemon: Add main loop Kevin Wolf
2019-11-08 16:02 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 10/18] qemu-storage-daemon: Add --chardev option Kevin Wolf
2019-11-08 16:27 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 11/18] monitor: Move monitor option parsing to monitor/monitor.c Kevin Wolf
2019-10-17 13:01 ` [RFC PATCH 12/18] stubs: Update monitor stubs for qemu-storage-daemon Kevin Wolf
2019-11-08 16:45 ` Markus Armbruster
2019-10-17 13:01 ` [RFC PATCH 13/18] qapi: Create module 'monitor' Kevin Wolf
2019-11-11 9:36 ` Markus Armbruster
2019-10-17 13:02 ` [RFC PATCH 14/18] monitor: Create monitor/qmp-cmds-monitor.c Kevin Wolf
2019-10-17 13:02 ` [RFC PATCH 15/18] qapi: Support empty modules Kevin Wolf
2019-11-12 8:29 ` Markus Armbruster
2019-10-17 13:02 ` [RFC PATCH 16/18] qapi: Create 'pragma' module Kevin Wolf
2019-11-12 9:41 ` Markus Armbruster
2019-10-17 13:02 ` [RFC PATCH 17/18] monitor: Move qmp_query_qmp_schema to qmp-cmds-monitor.c Kevin Wolf
2019-10-17 13:02 ` [RFC PATCH 18/18] qemu-storage-daemon: Add --monitor option Kevin Wolf
2019-11-06 14:32 ` Max Reitz
2019-11-07 10:12 ` Kevin Wolf
2019-11-07 10:44 ` Max Reitz
2019-11-08 8:59 ` Markus Armbruster
2019-11-12 14:25 ` Markus Armbruster
2019-11-13 10:58 ` Kevin Wolf
2019-11-13 13:53 ` Markus Armbruster
2019-10-24 11:33 ` [RFC PATCH 00/18] Add qemu-storage-daemon Kevin Wolf
2019-10-24 13:55 ` Vladimir Sementsov-Ogievskiy
2019-11-14 10:44 ` Kevin Wolf
2019-11-05 15:52 ` Stefan Hajnoczi
2019-11-06 14:37 ` Max Reitz
2019-11-06 14:58 ` Kevin Wolf
2019-11-06 15:35 ` Max Reitz
2019-11-06 17:13 ` Eric Blake
2019-11-21 10:32 ` Stefan Hajnoczi
2019-11-21 11:08 ` Kevin Wolf
2019-12-12 11:16 ` Stefan Hajnoczi
2019-11-07 10:33 ` Daniel P. Berrangé [this message]
2019-11-07 12:03 ` 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=20191107103357.GB120292@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).