qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] qemu-img: Add --pkgversion common option
@ 2015-01-08 14:30 Don Slutz
  2015-01-08 14:40 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Don Slutz @ 2015-01-08 14:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Don Slutz, Stefan Hajnoczi

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(+)

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)) {
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-09 19:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08 14:30 [Qemu-devel] [PATCH 1/1] qemu-img: Add --pkgversion common option Don Slutz
2015-01-08 14:40 ` Peter Maydell
2015-01-08 16:41   ` Eric Blake
2015-01-09 15:28     ` Don Slutz
2015-01-09 16:13       ` Eric Blake
2015-01-09 18:02         ` Don Slutz
2015-01-09 19:13           ` Don Slutz

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).