From b9c15f16d702306aeb984f30490cddb8b418a231 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 26 Aug 2011 17:38:13 -0300 Subject: qapi: Convert query-version Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- qmp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'qmp.c') diff --git a/qmp.c b/qmp.c index 8aa9c66bd2..f978ea4240 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; +} -- cgit v1.2.3