aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-08-26 17:38:13 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-04 11:01:30 -0300
commitb9c15f16d702306aeb984f30490cddb8b418a231 (patch)
tree6952fefe9fb9e4470556c8788032ff53bd0a8572 /qmp.c
parent48a32bedfed0ea5b30bdbb470c0520acdadc3bf2 (diff)
downloadqemu-b9c15f16d702306aeb984f30490cddb8b418a231.zip
qemu-b9c15f16d702306aeb984f30490cddb8b418a231.tar.gz
qemu-b9c15f16d702306aeb984f30490cddb8b418a231.tar.bz2
qapi: Convert query-version
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index 8aa9c66..f978ea4 100644
--- a/qmp.c
+++ b/qmp.c
@@ -26,3 +26,19 @@ NameInfo *qmp_query_name(Error **errp)
return info;
}
+
+VersionInfo *qmp_query_version(Error **err)
+{
+ VersionInfo *info = g_malloc0(sizeof(*info));
+ const char *version = QEMU_VERSION;
+ char *tmp;
+
+ info->qemu.major = strtol(version, &tmp, 10);
+ tmp++;
+ info->qemu.minor = strtol(tmp, &tmp, 10);
+ tmp++;
+ info->qemu.micro = strtol(tmp, &tmp, 10);
+ info->package = g_strdup(QEMU_PKGVERSION);
+
+ return info;
+}