diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-08-26 17:38:13 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-04 11:01:30 -0300 |
commit | b9c15f16d702306aeb984f30490cddb8b418a231 (patch) | |
tree | 6952fefe9fb9e4470556c8788032ff53bd0a8572 /qmp.c | |
parent | 48a32bedfed0ea5b30bdbb470c0520acdadc3bf2 (diff) | |
download | qemu-b9c15f16d702306aeb984f30490cddb8b418a231.tar.gz qemu-b9c15f16d702306aeb984f30490cddb8b418a231.tar.bz2 qemu-b9c15f16d702306aeb984f30490cddb8b418a231.zip |
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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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; +} |