From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Alexander Graf" <agraf@suse.de>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Eric Blake" <eblake@redhat.com>,
qemu-ppc@nongnu.org, "Richard Henderson" <rth@twiddle.net>,
"Markus Armbruster" <armbru@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [PATCH 4/4] switch machine types to QemuSupportState
Date: Tue, 30 Oct 2018 12:13:48 +0100 [thread overview]
Message-ID: <20181030111348.14713-5-kraxel@redhat.com> (raw)
In-Reply-To: <20181030111348.14713-1-kraxel@redhat.com>
So we can indicate machine type support state.
For starters switch over the current deprecation_reason users.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/hw/boards.h | 5 ++---
hw/i386/pc_piix.c | 3 ++-
hw/ppc/prep.c | 3 ++-
vl.c | 6 +++---
4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index f82f28468b..25e5d8b292 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -106,8 +106,7 @@ typedef struct {
/**
* MachineClass:
- * @deprecation_reason: If set, the machine is marked as deprecated. The
- * string should provide some clear information about what to use instead.
+ * @supported: support state of the machine type.
* @max_cpus: maximum number of CPUs supported. Default: 1
* @min_cpus: minimum number of CPUs supported. Default: 1
* @default_cpus: number of CPUs instantiated if none are specified. Default: 1
@@ -167,7 +166,7 @@ struct MachineClass {
char *name;
const char *alias;
const char *desc;
- const char *deprecation_reason;
+ QemuSupportState supported;
void (*init)(MachineState *state);
void (*reset)(void);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index dc09466b3e..bc238cc465 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -957,7 +957,8 @@ static void pc_i440fx_0_11_machine_options(MachineClass *m)
{
pc_i440fx_0_12_machine_options(m);
m->hw_version = "0.11";
- m->deprecation_reason = "use a newer machine type instead";
+ m->supported.state = SUPPORT_STATE_DEPRECATED;
+ m->supported.reason = "use a newer machine type instead";
SET_MACHINE_COMPAT(m, PC_COMPAT_0_11);
}
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 2afb7f437e..ab1c2bcc7d 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -588,7 +588,8 @@ static void ppc_prep_init(MachineState *machine)
static void prep_machine_init(MachineClass *mc)
{
- mc->deprecation_reason = "use 40p machine type instead";
+ mc->supported.state = SUPPORT_STATE_DEPRECATED;
+ mc->supported.reason = "use 40p machine type instead";
mc->desc = "PowerPC PREP platform";
mc->init = ppc_prep_init;
mc->block_default_type = IF_IDE;
diff --git a/vl.c b/vl.c
index 1fcacc5caa..83506de0cc 100644
--- a/vl.c
+++ b/vl.c
@@ -2573,7 +2573,7 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
}
printf("%-20s %s%s%s\n", mc->name, mc->desc,
mc->is_default ? " (default)" : "",
- mc->deprecation_reason ? " (deprecated)" : "");
+ qemu_is_deprecated(&mc->supported) ? " (deprecated)" : "");
}
}
@@ -4290,9 +4290,9 @@ int main(int argc, char **argv, char **envp)
configure_accelerator(current_machine);
- if (!qtest_enabled() && machine_class->deprecation_reason) {
+ if (!qtest_enabled() && qemu_is_deprecated(&machine_class->supported)) {
error_report("Machine type '%s' is deprecated: %s",
- machine_class->name, machine_class->deprecation_reason);
+ machine_class->name, machine_class->supported.reason);
}
/*
--
2.9.3
next prev parent reply other threads:[~2018-10-30 11:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 11:13 [Qemu-devel] [PATCH 0/4] Introducing QemuSupportState Gerd Hoffmann
2018-10-30 11:13 ` [Qemu-devel] [PATCH 1/4] add QemuSupportState Gerd Hoffmann
2018-10-30 13:32 ` Philippe Mathieu-Daudé
2018-10-30 14:00 ` Gerd Hoffmann
2018-10-30 14:13 ` Philippe Mathieu-Daudé
2018-10-30 15:46 ` Cornelia Huck
2018-10-30 17:37 ` Philippe Mathieu-Daudé
2018-10-30 23:15 ` Eduardo Habkost
2018-10-31 9:22 ` Cornelia Huck
2018-11-05 7:30 ` Gerd Hoffmann
2018-11-05 13:49 ` Eduardo Habkost
2018-11-06 6:56 ` Gerd Hoffmann
2018-10-31 16:04 ` John Snow
2018-10-31 18:06 ` Eduardo Habkost
2018-10-31 18:37 ` John Snow
2018-10-31 18:58 ` Eduardo Habkost
2018-10-31 20:05 ` John Snow
2018-11-05 7:46 ` Gerd Hoffmann
2018-10-30 14:54 ` Eduardo Habkost
2018-10-30 15:02 ` Eduardo Habkost
2018-10-30 17:30 ` [Qemu-devel] [Qemu-ppc] " Murilo Opsfelder Araujo
2018-10-30 11:13 ` [Qemu-devel] [PATCH 2/4] add QemuSupportState to DeviceClass Gerd Hoffmann
2018-10-30 11:13 ` [Qemu-devel] [PATCH 3/4] tag cirrus as obsolete Gerd Hoffmann
2018-10-30 11:22 ` Paolo Bonzini
2018-10-30 11:13 ` Gerd Hoffmann [this message]
2018-10-30 11:22 ` [Qemu-devel] [PATCH 0/4] Introducing QemuSupportState Paolo Bonzini
2018-10-30 14:34 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181030111348.14713-5-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=hpoussin@reactos.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.