From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
Paolo Bonzini <pbonzini@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] configure: Add missing space when using --with-pkgversion
Date: Thu, 15 Feb 2018 10:08:12 +0000 [thread overview]
Message-ID: <20180215100812.GC3322@redhat.com> (raw)
In-Reply-To: <933068e0-7928-389b-f927-15df79506bc6@redhat.com>
On Thu, Feb 15, 2018 at 07:02:40AM +0100, Thomas Huth wrote:
> On 14.02.2018 21:23, Eric Blake wrote:
> > On 02/14/2018 11:31 AM, Thomas Huth 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)
> >>
> >> Fix it by moving the space from the configure script to the Makefile.
> >>
> >> Fixes: 67a1de0d195a6185c39b436159c9ffc7720bf979
> >> Buglink: https://bugs.launchpad.net/qemu/+bug/1673373
> >> Signed-off-by: Thomas Huth <thuth@redhat.com>
> >> ---
> >> Makefile | 2 +-
> >> configure | 2 +-
> >> 2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/Makefile b/Makefile
> >> index 4ec7a3c..41adbc9 100644
> >> --- a/Makefile
> >> +++ b/Makefile
> >> @@ -369,7 +369,7 @@ qemu-version.h: FORCE
> >> (cd $(SRC_PATH); \
> >> printf '#define QEMU_PKGVERSION '; \
> >> if test -n "$(PKGVERSION)"; then \
> >> - printf '"$(PKGVERSION)"\n'; \
> >> + printf '" ($(PKGVERSION))"\n'; \
> >
> > I would argue that putting a space here is awkward; wouldn't it instead
> > be easier to have all CLIENTS of QEMU_PKGVERSION in the source code
> > assume that the macro does NOT have a leading space, and to supply a
> > space themselves?
> >
> > That is, change THESE locations:
> >
> > bsd-user/main.c: printf("qemu-" TARGET_NAME " version " QEMU_VERSION
> > QEMU_PKGVERSION
> > linux-user/main.c: printf("qemu-" TARGET_NAME " version "
> > QEMU_VERSION QEMU_PKGVERSION
> > qemu-img.c:#define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION
> > QEMU_PKGVERSION \
> > qemu-io.c: printf("%s version " QEMU_VERSION QEMU_PKGVERSION
> > "\n"
> > qemu-nbd.c:"%s " QEMU_VERSION QEMU_PKGVERSION "\n"
> > qga/main.c:"QEMU Guest Agent " QEMU_VERSION QEMU_PKGVERSION "\n"
> > scsi/qemu-pr-helper.c:"%s " QEMU_VERSION QEMU_PKGVERSION "\n"
> > ui/cocoa.m: @"QEMU emulator version %s%s", QEMU_VERSION,
> > QEMU_PKGVERSION];
> > vl.c: printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION "\n"
> >
> > to instead supply the missing space, and have configure/Makefile always
> > generate without a leading space.
> >
> >> +++ b/configure
> >> @@ -1162,7 +1162,7 @@ for opt do
> >> ;;
> >> --disable-blobs) blobs="no"
> >> ;;
> >> - --with-pkgversion=*) pkgversion=" ($optarg)"
> >> + --with-pkgversion=*) pkgversion="$optarg"
> >
> > Hmm - here you're changing who supplies the (). But that argues that
> > maybe the callsites should supply " (" and ")" themselves.
>
> Yeah, that's likely the saner way to do this. The question is: What
> about the query-version QMP command? Should it report parentheses or
> not? I think I'd look nicer if it reports "package": "foo" instead of
> "package": "(foo)" - but we maybe could break some users who expect
> parentheses there (no matter whether there is a preceding space or not)?
The pkgversion is an opaque string - users/apps should never try to
interpret its contents, because its format can vary arbitrarily between
distros. It is merely intended as an informative string to help the
package maintainer identify which version of QEMU was used when someone
submits a bug reoprt.
IOW it is totally valid to change the command to omit '()', and if anything
breaks that is their own fault for trying to interpret an opaque blob of
data.
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:[~2018-02-15 10:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 17:31 [Qemu-devel] [PATCH] configure: Add missing space when using --with-pkgversion Thomas Huth
2018-02-14 18:33 ` Peter Maydell
2018-02-14 20:00 ` Thomas Huth
2018-02-14 20:15 ` Eric Blake
2018-02-14 20:23 ` Eric Blake
2018-02-15 6:02 ` Thomas Huth
2018-02-15 10:08 ` Daniel P. Berrangé [this message]
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=20180215100812.GC3322@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=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).