[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] Introduce (x86) CPU model deprecation API
From: |
Eric Blake |
Subject: |
Re: [PATCH 1/2] Introduce (x86) CPU model deprecation API |
Date: |
Wed, 3 Jun 2020 09:11:19 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 6/3/20 6:47 AM, Robert Hoo wrote:
Complement versioned CPU model framework with the ability of marking some
versions deprecated. When that CPU model is chosen, get some warning. The
warning message is customized, e.g. telling in which future QEMU version will
it be obsoleted.
The deprecation message will also appear by x86_cpu_list_entry(), e.g. '-cpu
help'.
QMP 'query-cpu-definitions' will also return a bool value indicating the
deprecation status.
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
---
exec.c | 3 +++
include/hw/core/cpu.h | 1 +
qapi/machine-target.json | 3 ++-
target/i386/cpu.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
4 files changed, 49 insertions(+), 3 deletions(-)
+++ b/qapi/machine-target.json
@@ -309,7 +309,8 @@
'static': 'bool',
'*unavailable-features': [ 'str' ],
'typename': 'str',
- '*alias-of' : 'str' },
+ '*alias-of' : 'str',
+ 'deprecated' : 'bool' },
Missing documentation of the new member. Should it be optional (present
only when true)?
@@ -1638,6 +1639,11 @@ struct X86CPUModel {
* This matters only for "-cpu help" and query-cpu-definitions
*/
bool is_alias;
+ /*
+ * If true, this is deprecated and obsoleted in the future.
+ * Trying to use deprecated CPU model shall be warned.
If true, this model is deprecated, and may be removed in the future.
Trying to use it now will cause a warning.
+ */
+ bool deprecated;
};
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org