|
|
7711c0 |
From 27de7538bc01f788b4b2b652e96817b3c80e760c Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: Laszlo Ersek <lersek@redhat.com>
|
|
|
7711c0 |
Date: Tue, 13 Nov 2018 18:16:36 +0100
|
|
|
7711c0 |
Subject: [PATCH 17/22] qapi: change the type of TargetInfo.arch from string to
|
|
|
7711c0 |
enum SysEmuTarget
|
|
|
7711c0 |
MIME-Version: 1.0
|
|
|
7711c0 |
Content-Type: text/plain; charset=UTF-8
|
|
|
7711c0 |
Content-Transfer-Encoding: 8bit
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: Laszlo Ersek <lersek@redhat.com>
|
|
|
7711c0 |
Message-id: <20181113181639.4999-4-lersek@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 83004
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 3/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget
|
|
|
7711c0 |
Bugzilla: 1607406
|
|
|
7711c0 |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
Now that we have @SysEmuTarget, it makes sense to restrict
|
|
|
7711c0 |
@TargetInfo.@arch to valid sysemu targets at the schema level.
|
|
|
7711c0 |
|
|
|
7711c0 |
Cc: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
7711c0 |
Cc: Eric Blake <eblake@redhat.com>
|
|
|
7711c0 |
Cc: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
7711c0 |
Message-Id: <20180427192852.15013-4-lersek@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit b47aa7b3d44dcedf7bf541563f70704f82f500d0)
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
arch_init.c | 4 +++-
|
|
|
7711c0 |
qapi/misc.json | 6 ++++--
|
|
|
7711c0 |
2 files changed, 7 insertions(+), 3 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/arch_init.c b/arch_init.c
|
|
|
7711c0 |
index 6ee0747..9597218 100644
|
|
|
7711c0 |
--- a/arch_init.c
|
|
|
7711c0 |
+++ b/arch_init.c
|
|
|
7711c0 |
@@ -29,6 +29,7 @@
|
|
|
7711c0 |
#include "hw/pci/pci.h"
|
|
|
7711c0 |
#include "hw/audio/soundhw.h"
|
|
|
7711c0 |
#include "qapi/qapi-commands-misc.h"
|
|
|
7711c0 |
+#include "qapi/error.h"
|
|
|
7711c0 |
#include "qemu/config-file.h"
|
|
|
7711c0 |
#include "qemu/error-report.h"
|
|
|
7711c0 |
#include "hw/acpi/acpi.h"
|
|
|
7711c0 |
@@ -112,7 +113,8 @@ TargetInfo *qmp_query_target(Error **errp)
|
|
|
7711c0 |
{
|
|
|
7711c0 |
TargetInfo *info = g_malloc0(sizeof(*info));
|
|
|
7711c0 |
|
|
|
7711c0 |
- info->arch = g_strdup(TARGET_NAME);
|
|
|
7711c0 |
+ info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
|
|
|
7711c0 |
+ &error_abort);
|
|
|
7711c0 |
|
|
|
7711c0 |
return info;
|
|
|
7711c0 |
}
|
|
|
7711c0 |
diff --git a/qapi/misc.json b/qapi/misc.json
|
|
|
7711c0 |
index 8b28270..7cf4fbc 100644
|
|
|
7711c0 |
--- a/qapi/misc.json
|
|
|
7711c0 |
+++ b/qapi/misc.json
|
|
|
7711c0 |
@@ -5,6 +5,8 @@
|
|
|
7711c0 |
# = Miscellanea
|
|
|
7711c0 |
##
|
|
|
7711c0 |
|
|
|
7711c0 |
+{ 'include': 'common.json' }
|
|
|
7711c0 |
+
|
|
|
7711c0 |
##
|
|
|
7711c0 |
# @qmp_capabilities:
|
|
|
7711c0 |
#
|
|
|
7711c0 |
@@ -2471,12 +2473,12 @@
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# Information describing the QEMU target.
|
|
|
7711c0 |
#
|
|
|
7711c0 |
-# @arch: the target architecture (eg "x86_64", "i386", etc)
|
|
|
7711c0 |
+# @arch: the target architecture
|
|
|
7711c0 |
#
|
|
|
7711c0 |
# Since: 1.2.0
|
|
|
7711c0 |
##
|
|
|
7711c0 |
{ 'struct': 'TargetInfo',
|
|
|
7711c0 |
- 'data': { 'arch': 'str' } }
|
|
|
7711c0 |
+ 'data': { 'arch': 'SysEmuTarget' } }
|
|
|
7711c0 |
|
|
|
7711c0 |
##
|
|
|
7711c0 |
# @query-target:
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|