Commit b47aa7b3 authored by Laszlo Ersek's avatar Laszlo Ersek Committed by Markus Armbruster
Browse files

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: default avatarLaszlo Ersek <lersek@redhat.com>
Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20180427192852.15013-4-lersek@redhat.com>
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
parent 9a801c7d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
}
+4 −2
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
# = Miscellanea
##

{ 'include': 'common.json' }

##
# @qmp_capabilities:
#
@@ -2449,12 +2451,12 @@
#
# Information describing the QEMU target.
#
# @arch: the target architecture (eg "x86_64", "i386", etc)
# @arch: the target architecture
#
# Since: 1.2.0
##
{ 'struct': 'TargetInfo',
  'data': { 'arch': 'str' } }
  'data': { 'arch': 'SysEmuTarget' } }

##
# @query-target: