diff mbox

[1/1] qemu-img: Add --pkgversion common option

Message ID 1420727405-9587-1-git-send-email-dslutz@verizon.com
State New
Headers show

Commit Message

Don Slutz Jan. 8, 2015, 2:30 p.m. UTC
This will output the QEMU_PKGVERSION which is set by configure's
--with-pkgversion=

Signed-off-by: Don Slutz <dslutz@verizon.com>
---
 qemu-img.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Peter Maydell Jan. 8, 2015, 2:40 p.m. UTC | #1
On 8 January 2015 at 14:30, Don Slutz <dslutz@verizon.com> wrote:
> This will output the QEMU_PKGVERSION which is set by configure's
> --with-pkgversion=

> +    /* Report pkgversion */
> +    if (!strcmp(cmdname, "--pkgversion")) {
> +        argc--; argv++; /* Drop special arg. */
> +        printf("qemu-img version " QEMU_VERSION
> +               " pkgversion " QEMU_PKGVERSION "\n");
> +        if (argc < 2) {
> +            return 0;
> +        }
> +        cmdname = argv[1]; /* Update */
> +    }

Wouldn't it be better to just report the QEMU_PKGVERSION
as part of the version info we already report in --version?
This would be consistent with both linux-user and the softmmu
emulators, which do:

 printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ",
Copyright (c) 2003-2008 Fabrice Bellard\n");

-- PMM
Eric Blake Jan. 8, 2015, 4:41 p.m. UTC | #2
On 01/08/2015 07:40 AM, Peter Maydell wrote:
> On 8 January 2015 at 14:30, Don Slutz <dslutz@verizon.com> wrote:
>> This will output the QEMU_PKGVERSION which is set by configure's
>> --with-pkgversion=
> 
>> +    /* Report pkgversion */
>> +    if (!strcmp(cmdname, "--pkgversion")) {
>> +        argc--; argv++; /* Drop special arg. */
>> +        printf("qemu-img version " QEMU_VERSION
>> +               " pkgversion " QEMU_PKGVERSION "\n");
>> +        if (argc < 2) {
>> +            return 0;
>> +        }
>> +        cmdname = argv[1]; /* Update */
>> +    }
> 
> Wouldn't it be better to just report the QEMU_PKGVERSION
> as part of the version info we already report in --version?
> This would be consistent with both linux-user and the softmmu
> emulators, which do:
> 
>  printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ",
> Copyright (c) 2003-2008 Fabrice Bellard\n");

I agree - output the information unconditionally on --version, rather
than inventing a new option.
Eric Blake Jan. 9, 2015, 4:13 p.m. UTC | #3
On 01/09/2015 08:28 AM, Don Slutz wrote:

[an encrypted message]

Oops, you probably want to fix your Thunderbird/Enigmail settings to
sign but not encrypt when a list is involved.
Don Slutz Jan. 9, 2015, 6:02 p.m. UTC | #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sigh.  Will look into this.
   -Don Slutz

On 01/09/15 11:13, Eric Blake wrote:
> On 01/09/2015 08:28 AM, Don Slutz wrote:
> 
> [an encrypted message]
> 
> Oops, you probably want to fix your Thunderbird/Enigmail settings
> to sign but not encrypt when a list is involved.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iQIcBAEBAgAGBQJUsBfAAAoJEHkofi8zcwBkiEwQAJRHWVs/355i9x5S8/zb6S1c
G2WEkcXPgy6/hidX2rtAB37fCT7+DkYtQq94pOXfhkIVlXhuTk5VX4tBfSKiZFPz
LtLoKXxfWMG/pcU3xQKrpW32ZIwafYfbYhSs/0LIIy4kyiEHJZ4AQ8GztRin/MRu
H8EF9QZOxR8W3934lHiU5J+qlp5ShIH2/1AUwXmr+P9tFjyldcJlo+Zv2PXdv2Zg
St7Z2WB0BlacA8i0rSo9I9lYDaVWPzxBqkRJMyCz8lqUC5KTMk+qend9H9VVsdkW
gpSYvyrf73rUMqauY6boJZjJxl5SiVktaTmxDkkOqQHH3wynryogEt85lywpNB2C
0v+isTvSou5qThVgMbPF6LOg5KzHoHYO5BPVjq9VIRVGsr2fHNkSLIHQ8YKKLnJO
vZGZSftozrcD+A4C2rWmYlKr/rTFaEYKLjd7K2U+oak2xWrFX2h/cd0lyY7syF29
i54Bcku91wFigymgJJ6BuSkIlsM+rPSuOF3UTPqLqIfKx/EjeanBtGlzR/vIGzvU
7wvOQPs0RtULmms6vPDpw8ZmQb+T2PVvFf4jmpknuRt/Wokxoyl+sNL5msmcgTzb
x0k+0TPhIvsvUo3HYoorGoaRZyZYgk6podL11uMCFr7Iq/Y+kqo2hUnG610bH5c5
s7w+oERv382PKof37RM6
=KSVr
-----END PGP SIGNATURE-----
Don Slutz Jan. 9, 2015, 7:13 p.m. UTC | #5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/09/15 13:02, Don Slutz wrote:
> Sigh.  Will look into this. -Don Slutz
> 

Here is what I said (un-encrypeted):

On 01/08/15 11:41, Eric Blake wrote:
> On 01/08/2015 07:40 AM, Peter Maydell wrote:
>> On 8 January 2015 at 14:30, Don Slutz <dslutz@verizon.com> 
>> wrote:

>> 
>> Wouldn't it be better to just report the QEMU_PKGVERSION as part 
>> of the version info we already report in --version? This would
>> be consistent with both linux-user and the softmmu emulators,
>> which do:

> 
> I agree - output the information unconditionally on --version, 
> rather than inventing a new option.
> 

Will do.  Have send out a v2.

   -Don Slutz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iQIcBAEBAgAGBQJUsChGAAoJEHkofi8zcwBkpJ4P/ipotMH4W4z3zZOaNKkPwwjp
NQzGmxNet4KqRZ32u1GKmSOhitGEpc/2nc0+e/vSPUnY24Tf9pA0vClTl9dJSjJw
DYLSyUl0yBIYvjsrt8ozkoD0IrTeDGC20a2/iHeg0935Ep/CcFOYPoCV/MIYbQX9
LwEEIBYa3mHq3scslBMsW/Do4brUjSv1KM9vWhGthoSiGeeXpG0wnjT9X2Y9QLY+
PuuMESYuYsoWtgeD4J2g9QgZ8N5MwtDw5maud4kdgDpD4yG+hQ/b7FGmptGQczxz
WSiwIIVhPXJkg121GNDXcUAqAEn3V2qBgYSK/A/oflCTBjw55kalzVI5vDcW14KO
VMTebc8wI+g9p3aBweCluezenYPdRgpLU9++14/YyfY5+Z5+hOKs7xOgujto9qWI
/jq8AO0Qgpas6tY40lcN7O09Oli0rIXQXOI1feFcxclY5wkydWBBTcZlx8vhaMxi
oP0ZT9z8Sp8BorHYpqYaPkQP3AQKCyUX5uI3A9omnNNT6TfcE5+OYPBvEewDvBAz
IwwIQ+zWWrYH0SHQOguKg488I/rJSm9jQ8eA/lmBDE+nKiH/nI8zGrxIlAQm8xQh
PEQUZj9uJEpEA8RFreSNxtxubCm9Ug83fedcXyg/Pdp3C9i2pkmObVTtlKsJnwEB
5w2hCXXcdNMGGuMRAes/
=1G1f
-----END PGP SIGNATURE-----
diff mbox

Patch

diff --git a/qemu-img.c b/qemu-img.c
index 7876258..f73bea6 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3064,6 +3064,17 @@  int main(int argc, char **argv)
     }
     cmdname = argv[1];
 
+    /* Report pkgversion */
+    if (!strcmp(cmdname, "--pkgversion")) {
+        argc--; argv++; /* Drop special arg. */
+        printf("qemu-img version " QEMU_VERSION
+               " pkgversion " QEMU_PKGVERSION "\n");
+        if (argc < 2) {
+            return 0;
+        }
+        cmdname = argv[1]; /* Update */
+    }
+
     /* find the command */
     for (cmd = img_cmds; cmd->name != NULL; cmd++) {
         if (!strcmp(cmdname, cmd->name)) {