From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "QEMU Trivial" <qemu-trivial@nongnu.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] osdep.h: Add doc comment for qemu_get_thread_id()
Date: Fri, 31 Jul 2020 08:46:40 -0500 [thread overview]
Message-ID: <53b70f7f-1777-64e5-d80f-6af3d6c1252d@redhat.com> (raw)
In-Reply-To: <87pn8ct9ga.fsf@dusky.pond.sub.org>
On 7/31/20 2:44 AM, Markus Armbruster wrote:
>>> Thread_id should be optional and thus not filled in if we
>>> can't provide a sensible value. Unfortunately we made it
>>> mandatory in QMP.
>>
>> Normally, converting a mandatory output value to optional is a
>> back-compatibility risk (we could break apps that depended on it being
>> present). But if the only apps that depended on it being present are
>> compiled on Linux, where the member will actually be present, I think
>> that changing the schema to make it optional for non-Linux platforms
>> won't be a back-compatibility nightmare (but we will have to be
>> careful in our documentation).
>
> Options for systems where don't know how to compute a system-wide thread
> ID:
>
> 0. Return a bogus value: the PID. This is the status quo.
>
> 1. Return a more obviously bogus value: -1. Semantic compatibility
> break. Should be harmless, because a QMP client relying on the
> thread-id being the PID would be insane.
>
> 2. Make thread-id optional, present iff we can compute a value.
>
> This is what we should have done, but we didn't, and now it's a
> syntactic compatibility break. Matters only if it actually breaks
> QMP clients. We believe the one we know shouldn't break.
>
> Preferences?
I'm in favor of 2, but can easily live with 1 if we decide to be that
much more conservative. Tooling that can't handle a missing value is
not going to fare any better with a value that is unusable because it is
-1, but the important point is that I don't think we have a scenario
with such tooling depending on the value (the tools that DO depend on
the value are built on platforms where the value is usable).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-07-31 13:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 15:41 [PATCH] osdep.h: Add doc comment for qemu_get_thread_id() Peter Maydell
2020-07-28 15:02 ` Peter Maydell
2020-07-28 15:16 ` Eric Blake
2020-07-28 15:25 ` Peter Maydell
2020-07-30 15:10 ` Markus Armbruster
2020-07-30 15:52 ` Peter Maydell
2020-07-30 15:59 ` Daniel P. Berrangé
2020-07-30 16:24 ` Eric Blake
2020-07-30 16:40 ` Daniel P. Berrangé
2020-07-31 7:44 ` Markus Armbruster
2020-07-31 13:46 ` Eric Blake [this message]
2020-07-31 13:51 ` Daniel P. Berrangé
2020-10-12 15:33 [PATCH 00/10] target/arm: Various v8.1M minor features Peter Maydell
2020-10-12 15:33 ` [PATCH] osdep.h: Add doc comment for qemu_get_thread_id() Peter Maydell
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=53b70f7f-1777-64e5-d80f-6af3d6c1252d@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).