qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Thomas Huth <thuth@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] configure: Add missing space when using --with-pkgversion
Date: Wed, 14 Feb 2018 14:15:53 -0600	[thread overview]
Message-ID: <ab218589-ebb1-b7dd-0e99-3db89d6a2f28@redhat.com> (raw)
In-Reply-To: <8d49363d-7569-e95d-1d06-17a572c922db@redhat.com>

On 02/14/2018 02:00 PM, Thomas Huth wrote:
> On 14.02.2018 19:33, Peter Maydell wrote:
>> On 14 February 2018 at 17:31, Thomas Huth <thuth@redhat.com> wrote:
>>> When running configure with --with-pkgversion=foo there is no
>>> space anymore between the version number and the parentheses:
>>>
>>> $ m68k-softmmu/qemu-system-m68k -version
>>> QEMU emulator version 2.11.50(foo)

It would be nice to document this as '--version' rather than '-version' 
(both work; but see our BiteSized task: 
https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation)

>>
>> -- does this patch change the QMP reported string
>> unexpectedly?
> 
> Without my patch and with --with-pkgversion=foo :
> 
> { "execute": "query-version" }
> {"return": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": "(foo)"}}

Looks nice.  And the version info is ALSO passed as part of the initial 
handshake, even before you call query-version.

> 
> With my patch and with --with-pkgversion=foo :
> 
> { "execute": "query-version" }
> {"return": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": " (foo)"}}

Potential regression (arguably cosmetic, though)

> 
> Without my patch and without --with-pkgversion :
> 
> { "execute": "query-version" }
> {"return": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": " (v2.11.0-1512-g02f4fbe)"}}

And that means we're already inconsistent, so your patch at least made 
things consistent,

> 
> Using the old QEMU version 67a1de0d19~1 with  --with-pkgversion=foo :
> 
> { "execute": "query-version" }
> {"return": {"qemu": {"micro": 50, "minor": 6, "major": 2}, "package": " (foo)"}}

and that means we've already "regressed", which further means:
- it definitely is cosmetic, if no one is complaining
- changing it to look nicer won't break anyone

> 
> So yes, this patch changes the behavior of query-version, but the new
> behavior is now the same behavior that you get without --with-pkgversion
> (i.e. a space is included) and it is the same as the behavior that we had
> in the past, before commit 67a1de0d19 has been merged. So I think this
> is the right way to go.
> Alternatively, we could maybe change query-version to always skip the
> initial space?

Yes, I like that option.

So, if I'm summarizing correctly, your v2 patch will have:

$ qemu --version
QEMU emulator version 2.11.50 (foo)

QMP query-version
{"return": {"qemu": {"micro": 50, "minor": 6, "major": 2}, "package": 
"(foo)"}}

regardless of whether --with-pkgversion was used during configure.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


  reply	other threads:[~2018-02-14 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 17:31 [Qemu-trivial] [PATCH] configure: Add missing space when using --with-pkgversion Thomas Huth
2018-02-14 18:33 ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
2018-02-14 20:00   ` Thomas Huth
2018-02-14 20:15     ` Eric Blake [this message]
2018-02-14 20:23 ` Eric Blake
2018-02-15  6:02   ` Thomas Huth
2018-02-15 10:08     ` Daniel P. Berrangé
2018-02-15 14:11       ` Eric Blake

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=ab218589-ebb1-b7dd-0e99-3db89d6a2f28@redhat.com \
    --to=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@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).