From: Stefan Hajnoczi <stefanha@gmail.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
libvir-list@redhat.com, Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel@nongnu.org, Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [libvirt] QMP: Supporting off tree APIs
Date: Fri, 6 Jan 2012 11:06:12 +0000 [thread overview]
Message-ID: <CAJSP0QU2yJjKro_LsNgULN6CDChkTMAphikpdZ8XFOaa3JwCbg@mail.gmail.com> (raw)
In-Reply-To: <20120105182633.01a7490e@doriath>
On Thu, Jan 5, 2012 at 8:26 PM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
> On Thu, 05 Jan 2012 09:56:44 -0600
> Anthony Liguori <aliguori@us.ibm.com> wrote:
>
>> On 01/05/2012 09:35 AM, Eric Blake wrote:
>> > On 01/05/2012 07:16 AM, Luiz Capitulino wrote:
>> >>> I know. We're stuck in a hard place here again because NotSupported
>> >>> has been in the Image Streaming API spec and hence implemented in
>> >>> libvirt for a while now. If we change this then an old client which
>> >>> only understands NotSupported will not know what to do with the
>> >>> Unsupported error.
>> >>>
>> >>> (Unsupported was not in QEMU when the Image Streaming API was defined.)
>> >>
>> >> Let me try to understand it: is libvirt relying on an off tree API and
>> >> we are now required to have stable guarantees to off tree APIs?
>> >
>> > No. Libvirt recognizes the off-tree spelling, but does not rely on it -
>> > after all, the goal of libvirt is to provide the high level action,
>> > using whatever underlying mechanism(s) necessary to get to that action,
>> > even if it means using several different attempts until one actually works.
>> >
>> > If a user has the older libvirt, which only expects the off-tree
>> > spelling, then that user's setup will break if they upgrade qemu but not
>> > libvirt. But that's not a severe problem - they could have only been
>> > relying on the situation if they were using an off-tree build in the
>> > first place, so they should be aware that upgrading qemu is a
>> > potentially risky scenario, and that they may have to deal with the pieces.
>>
>> Right, this is the difference between ABI compatibility and strict backwards
>> compatibility.
>>
>> To achieve ABI compatibility, we need to not overload BLOCK_JOB_COMPLETED to
>> mean something other than libvirt what expects it to mean.
>>
>> We MUST provide ABI compatibility and SHOULD provide backwards compatibility
>> whenever possible.
>>
>> In this case, I'd suggest that in the very least, we should add
>> BLOCK_JOB_COMPLETED to qapi-schema.json with gen=False set. That way it's
>> codified in the schema to ensure we maintain ABI compatibility.
>>
>> That said, I'm inclined to say that we should just use the BLOCK_JOB_COMPLETED
>> name because I don't think we gain a lot by using QMP_JOB_COMPLETED (not that we
>> shouldn't introduce it, but using it here isn't going to make or break anything).
>
> What I'm proposing is not just a rename, but adding proper async support to QMP,
> instead of adding something that is specific to the block layer.
Proper async support - if you mean the ability to have multiple QMP
commands pending at a time - is harder than just fixing QEMU. Clients
also need to start taking advantage of it. Clients that do not will
be unable to continue when a QMP command takes a long time to
complete.
I think avoiding long-running QMP commands is a good idea. We have
events which can be used to signal completion. It's easy to implement
and does not require clients to change the way they think about QMP
commands.
Today I doubt many QMP clients have implemented multiple pending
commands, although the wire protocol allows it.
>> With respect to libvirt relying on interfaces before they exist in QEMU, we need
>> to be a bit flexible here. We want to get better at co-development to help make
>> libvirt support QEMU features as the bleeding edge.
>>
>> Forcing libvirt to wait until a feature is fully baked in QEMU will ensure
>> there's always a feature gap in libvirt which is in none of our best interests.
>
> We can ask them to wait at least until the API is merged. Most good review
> and potential problems will only come when the patches are worked on and
> reviewed on the list.
The API was agreed on between QEMU and libvirt developers on the mailing
lists - you were included in that process. Back in August I sent
patches which you saw ("[0/4] Image Streaming API").
I know the API is not what we'd design today when it comes to the
cosmetics. We'd want to name things differently, use the Unsupported
event which was introduced in the meantime, and maybe make the job
completion concept generic.
QMP and QAPI have evolved in the time that this feature has been
reimplemented. I have tried to keep up with QMP but the API itself is
from August. We can't keep redrawing the lines.
In summary:
* The API was designed and agreed several months ago.
* You saw it back then and I've kept you up-to-date along the way.
* It predates current QAPI conventions.
* Merging it poses no problem, changing the API breaks existing libvirt.
I do feel bad that the code has been out of qemu.git for so long and I
certainly won't attempt this again in the future. But I really think
the pros and cons say we should accept it as an August 2011 API just
like many of the other HMP/QMP commands we carry.
Regarding being more flexible about working together with libvirt, I
do think it's important to work on APIs together. This avoids use
developing something purely from the QEMU internal perspective which
turns out to be unconsumable by our biggest QMP user :).
Stefan
next prev parent reply other threads:[~2012-01-06 11:06 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 13:52 [Qemu-devel] [PATCH v3 0/9] block: generic image streaming Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 1/9] coroutine: add co_sleep_ns() coroutine sleep function Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 2/9] block: add BlockJob interface for long-running operations Stefan Hajnoczi
2011-12-14 13:51 ` Kevin Wolf
2011-12-15 8:50 ` Stefan Hajnoczi
2011-12-15 10:40 ` Marcelo Tosatti
2011-12-16 8:09 ` Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 3/9] block: add image streaming block job Stefan Hajnoczi
2011-12-13 14:14 ` Marcelo Tosatti
2011-12-13 15:18 ` Stefan Hajnoczi
2011-12-14 13:59 ` Kevin Wolf
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 4/9] block: rate-limit streaming operations Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 5/9] qmp: add block_stream command Stefan Hajnoczi
2012-01-04 12:59 ` Luiz Capitulino
2012-01-04 13:11 ` Luiz Capitulino
2012-01-05 13:48 ` Stefan Hajnoczi
2012-01-05 14:16 ` [Qemu-devel] QMP: Supporting off tree APIs Luiz Capitulino
2012-01-05 15:35 ` [Qemu-devel] [libvirt] " Eric Blake
2012-01-05 15:56 ` Anthony Liguori
2012-01-05 20:26 ` Luiz Capitulino
2012-01-06 11:06 ` Stefan Hajnoczi [this message]
2012-01-06 12:45 ` Luiz Capitulino
2012-01-06 15:08 ` Anthony Liguori
2012-01-06 19:42 ` Luiz Capitulino
2012-01-10 19:18 ` Anthony Liguori
2012-01-10 20:55 ` Luiz Capitulino
2012-01-10 21:02 ` Anthony Liguori
2012-01-11 1:41 ` Luiz Capitulino
2012-01-05 14:20 ` [Qemu-devel] [PATCH v3 5/9] qmp: add block_stream command Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 6/9] qmp: add block_job_set_speed command Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 7/9] qmp: add block_job_cancel command Stefan Hajnoczi
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 8/9] qmp: add query-block-jobs Stefan Hajnoczi
2011-12-14 14:54 ` Kevin Wolf
2011-12-15 8:27 ` Stefan Hajnoczi
2011-12-15 10:34 ` Kevin Wolf
2011-12-15 11:30 ` Luiz Capitulino
2011-12-15 12:00 ` Stefan Hajnoczi
2011-12-15 12:09 ` Luiz Capitulino
2011-12-15 12:37 ` Kevin Wolf
2011-12-15 12:51 ` Stefan Hajnoczi
2012-01-04 13:17 ` Luiz Capitulino
2011-12-13 13:52 ` [Qemu-devel] [PATCH v3 9/9] test: add image streaming test cases Stefan Hajnoczi
2011-12-13 14:12 ` [Qemu-devel] [PATCH v3 0/9] block: generic image streaming Yibin Shen
2011-12-13 15:18 ` Stefan Hajnoczi
2011-12-14 1:42 ` Yibin Shen
2011-12-14 10:50 ` Stefan Hajnoczi
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=CAJSP0QU2yJjKro_LsNgULN6CDChkTMAphikpdZ8XFOaa3JwCbg@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=libvir-list@redhat.com \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.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).