diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-09-12 13:18:56 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2016-09-19 17:32:21 +0200 |
commit | 3688d8c717927e7ecaa8c260bc9cc706e3dbef7e (patch) | |
tree | 5bd9176e8ee634fe950a375de04ef572b41ae423 /qmp.c | |
parent | e3571ae30cd26d19efd4554c25e32ef64d6a36b3 (diff) |
build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO}
There are better chances to find what went wrong at build time than a
later assert in qmp_query_version
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20160912091913.15831-2-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r-- | qmp.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -51,21 +51,11 @@ NameInfo *qmp_query_name(Error **errp) VersionInfo *qmp_query_version(Error **errp) { VersionInfo *info = g_new0(VersionInfo, 1); - const char *version = QEMU_VERSION; - const char *tmp; - int err; info->qemu = g_new0(VersionTriple, 1); - err = qemu_strtoll(version, &tmp, 10, &info->qemu->major); - assert(err == 0); - tmp++; - - err = qemu_strtoll(tmp, &tmp, 10, &info->qemu->minor); - assert(err == 0); - tmp++; - - err = qemu_strtoll(tmp, &tmp, 10, &info->qemu->micro); - assert(err == 0); + info->qemu->major = QEMU_VERSION_MAJOR; + info->qemu->minor = QEMU_VERSION_MINOR; + info->qemu->micro = QEMU_VERSION_MICRO; info->package = g_strdup(QEMU_PKGVERSION); return info; |