aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
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 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;
+}