From: Kevin Wolf <kwolf@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Markus Armbruster <armbru@redhat.com>,
Jeff Cody <jcody@redhat.com>,
qemu-devel@nongnu.org, kraxel@redhat.com,
Stefan Hajnoczi <stefanha@redhat.com>,
John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 00/25] qmp: add async command type
Date: Tue, 2 May 2017 12:42:04 +0200 [thread overview]
Message-ID: <20170502104204.GA5805@noname.redhat.com> (raw)
In-Reply-To: <CAJ+F1CLM9UzgMxNJm3T+Uaog7Ki+6Pu6bO6Z7d4Vyce3FNEj8Q@mail.gmail.com>
Am 02.05.2017 um 11:05 hat Marc-André Lureau geschrieben:
> On Fri, Apr 28, 2017 at 11:13 PM Kevin Wolf <kwolf@redhat.com> wrote:
>
> > Am 28.04.2017 um 17:55 hat Marc-André Lureau geschrieben:
> > > On Tue, Apr 25, 2017 at 2:23 PM Kevin Wolf <kwolf@redhat.com> wrote:
> > >
> > > > Am 24.04.2017 um 21:10 hat Markus Armbruster geschrieben:
> > > > > With 2.9 out of the way, how can we make progress on this one?
> > > > >
> > > > > I can see two ways to get asynchronous QMP commands accepted:
> > > > >
> > > > > 1. We break QMP compatibility in QEMU 3.0 and convert all
> > long-running
> > > > > tasks from "synchronous command + event" to "asynchronous
> > command".
> > > > >
> > > > > This is design option 1 quoted below. *If* we decide to leave
> > > > > compatibility behind for 3.0, *and* we decide we like the
> > > > > asynchronous sufficiently better to put in the work, we can do it.
> > > > >
> > > > > I guess there's nothing to do here until we decide on breaking
> > > > > compatibility in 3.0.
> > > > >
> > > > > 2. We don't break QMP compatibility, but we add asynchronous commands
> > > > > anyway, because we decide that's how we want to do "jobs".
> > > > >
> > > > > This is design option 3 quoted below. As I said, I dislike its
> > lack
> > > > > of orthogonality. But if asynchronous commands help us get jobs
> > > > > done, I can bury my dislike.
> > > >
> > > > I don't think async commands are attractive at all for doing jobs. I
> > >
> > > It's still a bit obscure to me what we mean by "jobs".
> >
> > I guess the best definition that we have is: Image streaming, mirroring,
> > live backup, live commit and future "similar things".
>
> What does it mean in terms of QAPI/QMP protocol ? If I need to write a new
> "job" (for something else than block op), is there some doc or guideline?
Well, we don't have a generic job API yet, so there can't be one. The
problem with using the current block job API for other things is that
block jobs are tied to one owner BlockDriverState (which made sense for
the very first block job, but already since the second one it doesn't
really match reality any more, because more than one image file is
involved in the other block job types).
John is working on generalising things so that we get a job API that can
be used for more than just block jobs.
> > > feel they bring up more questions that they answer, for example, what
> > > > happens if libvirt crashes and then reconnects? Which monitor
> > connection
> > > > does get the reply for an async command sent on the now disconnected
> > > > one?
> > > >
> > >
> > > The monitor to receive a reply is the one that sent the command (just
> > > like return today)
> > >
> > > As explained in the cover letter, an async command may cancel the
> > > ongoing operation on disconnect.
> >
> > But that's not what you generally want. You don't want to abort your
> > backup just because libvirt lost its monitor connection, but qemu should
> > continue to copy the data, and when libvirt reconnects it should be able
> > to get back control of this background operation and bring it to
> > successful completion.
>
> I said "may", and I make a difference between "local" (to the client) and
> "global" (to qemu) operation.
The "may" doesn't help you because it's your only option as long as you
don't have a mechanism to attach an already running command to a new
monitor.
But the local vs. global thing that you detailed below makes sense and
now I think we were really talking past each other. Block jobs are very
much global, and so we actually agree that this proposal has nothing to
do with the operations that are currently block jobs. I guess what I'm
really arguing against then is what Markus made of your proposal in his
reply (which is when I got CCed).
> > > > On the other hand, using the traditional job infrastructure is way
> > > > over the top if all you want to do is 'query-block', so we need
> > > > something different for making it async. And if a client
> > > > disconnects, the 'query-block' result can just be thrown away, it's
> > > > much simpler than actual jobs.
> > >
> > > I agree a fully-featured job infrastructure is way over the top, and I
> > > believe I propose a minimal change to make optionnally some QMP
> > > commands async.
> >
> > So are commands like 'query-block' (which are typically _not_ considered
> > long-running) what you're aiming for with your proposal? This is a case
> > where I think we could consider the use of async QMP commands, but I
> > didn't have the impression that this kind of commands was your primary
> > target.
> >
>
> Typically, I would like to improve the case described in the cover
> letter where we have:
>
> -> { "execute": "do-foo" }
> <- { "return": {} }
> <- { "event": "FOO_DONE" }
>
> Let's call this an "hidden-async" (I will refer to this pattern later).
This is not a good description of what you really seem to be after,
because the hidden-async pattern is what is used for real long-running,
global impact commands like the block jobs, too.
You only seem to want to replace it if 'do-foo' is a "local" operation,
and then that's much more agreeable than if we were to apply it to every
operation, including "global" ones.
> And do instead:
>
> -> { "execute": "do-foo" }
> <- { "return": {} }
>
> (I won't repeat the flaws of the current status quo here, see cover and
> thread)
>
> But any blocking (even shortly) operation could also benefit from this
> series by using the async variant to allow reentering the loop. This
> is the 1). I suppose 'query-block' is a good candidate, and typically
> could cancel itself it the client is gone.
>
> 2) is an extra, if the client supports concurrent commands.
I believe allowing 1) is a good idea anyway. Whether or not we need 2)
is a different discussion, but given the scope of the proposal that I
understand now, possibly not one in which I need to participate.
> > > <- { "event": "FOO_DONE" } (this is a broadcasted event that
> > other
> > > monitor may not know how to deal with, lack of consistency with naming
> > for
> > > various async op, "id" field may be lost, no facilities in generated code
> > > etc etc)
> >
> > Are these theoretical concerns or do you see them confirmed with
> > actually existing commands?
> >
> I think existing commands using this event pattern are all global. The
> problems raise if we start using events for local commands (such as
> screendump, dump-guest-memory, query-* etc), then various peers may
> conflict the completion event from a different client command.
So what you're really trying is not to replace existing hidden-async
patterns (which are for global operations, so events are wanted), but
to avoid introducing the pattern for new, local operations.
I think this is one of the most important points where the
misunderstandings came from.
> Your concern regarding async testing exist at a different protocol
> level when commands use the cmd + event pattern (hidden-async),
> regardless of this proposal.
This was Markus' concern, I was just trying to explain how I understand
it. And I still think it's a valid concern, but you're right that cmd +
event isn't much different. It's mostly the comparison between sync and
either of the async models that is interesting here.
Kevin
next prev parent reply other threads:[~2017-05-02 10:42 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 16:03 [Qemu-devel] [PATCH v2 00/25] qmp: add async command type Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 01/25] tests: start generic qemu-qmp tests Marc-André Lureau
2017-01-18 16:14 ` Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 02/25] tests: change /0.15/* tests to /qmp/* Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 03/25] qmp: teach qmp_dispatch() to take a pre-filled QDict Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 04/25] qmp: use a return callback for the command reply Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 05/25] qmp: add QmpClient Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 06/25] qmp: add qmp_return_is_cancelled() Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 07/25] qmp: introduce async command type Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 08/25] qapi: ignore top-level 'id' field Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 09/25] qmp: take 'id' from request Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 10/25] qmp: check that async command have an 'id' Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 11/25] scripts: learn 'async' qapi commands Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 12/25] tests: add dispatch async tests Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 13/25] monitor: add 'async' capability Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 14/25] monitor: add !qmp pre-conditions Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 15/25] monitor: suspend when running async and client has no async Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 16/25] qmp: update qmp-spec about async capability Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 17/25] qtest: add qtest-timeout Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 18/25] qtest: add qtest_init_qmp_caps() Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 19/25] tests: add tests for async and non-async clients Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 20/25] qapi: improve 'screendump' documentation Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 21/25] console: graphic_hw_update return true if async Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 22/25] console: add graphic_hw_update_done() Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 23/25] console: make screendump async Marc-André Lureau
2017-01-19 8:20 ` Gerd Hoffmann
2017-01-20 13:07 ` Marc-André Lureau
2017-01-23 12:04 ` Gerd Hoffmann
2017-01-23 12:35 ` Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 24/25] qtest: add /qemu-qmp/screendump test Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 25/25] qmp: move json-message-parser and check to QmpClient Marc-André Lureau
2017-01-18 17:35 ` [Qemu-devel] [PATCH v2 00/25] qmp: add async command type no-reply
2017-01-23 10:55 ` Stefan Hajnoczi
2017-01-23 11:27 ` Marc-André Lureau
2017-01-24 11:43 ` Stefan Hajnoczi
2017-01-24 18:43 ` Marc-André Lureau
2017-01-30 13:43 ` Stefan Hajnoczi
2017-01-30 18:18 ` Marc-André Lureau
2017-01-31 7:43 ` Gerd Hoffmann
2017-01-31 8:18 ` Markus Armbruster
2017-02-01 16:25 ` Stefan Hajnoczi
2017-02-01 20:25 ` Marc-André Lureau
2017-02-02 10:13 ` Stefan Hajnoczi
2017-01-25 15:16 ` Markus Armbruster
2017-04-24 19:10 ` Markus Armbruster
2017-04-25 0:06 ` John Snow
2017-04-25 6:55 ` Markus Armbruster
2017-04-25 9:13 ` Daniel P. Berrange
2017-04-25 10:22 ` Kevin Wolf
2017-04-28 15:55 ` Marc-André Lureau
2017-04-28 19:13 ` Kevin Wolf
2017-05-02 8:30 ` Gerd Hoffmann
2017-05-02 9:05 ` Marc-André Lureau
2017-05-02 10:42 ` Kevin Wolf [this message]
2017-05-04 19:01 ` Markus Armbruster
2017-05-05 9:00 ` Marc-André Lureau
2017-05-05 12:35 ` Markus Armbruster
2017-05-05 12:54 ` Marc-André Lureau
2017-05-05 13:50 ` Markus Armbruster
2017-05-05 12:27 ` Kevin Wolf
2017-05-05 12:51 ` Markus Armbruster
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=20170502104204.GA5805@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@gmail.com \
--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).