diff options
author | Laszlo Ersek <lersek@redhat.com> | 2018-04-27 21:28:50 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-05-04 08:27:53 +0200 |
commit | b47aa7b3d44dcedf7bf541563f70704f82f500d0 (patch) | |
tree | 59d1615a2cb3cb050edb50c8fe9c6a0dd14fc03e /arch_init.c | |
parent | 9a801c7d6c8fd927df915f2ac3eacd306e8fc334 (diff) |
qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget
Now that we have @SysEmuTarget, it makes sense to restrict
@TargetInfo.@arch to valid sysemu targets at the schema level.
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180427192852.15013-4-lersek@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r-- | arch_init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch_init.c b/arch_init.c index 6ee07478bd..9597218ced 100644 --- a/arch_init.c +++ b/arch_init.c @@ -29,6 +29,7 @@ #include "hw/pci/pci.h" #include "hw/audio/soundhw.h" #include "qapi/qapi-commands-misc.h" +#include "qapi/error.h" #include "qemu/config-file.h" #include "qemu/error-report.h" #include "hw/acpi/acpi.h" @@ -112,7 +113,8 @@ TargetInfo *qmp_query_target(Error **errp) { TargetInfo *info = g_malloc0(sizeof(*info)); - info->arch = g_strdup(TARGET_NAME); + info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1, + &error_abort); return info; } |