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...@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


Reply via email to