dc1fe0
From dcc64971bf25e5c2303d551fb2fef448a5e8f4fd Mon Sep 17 00:00:00 2001
dc1fe0
From: Cornelia Huck <cohuck@redhat.com>
dc1fe0
Date: Thu, 3 Mar 2022 10:57:37 +0100
dc1fe0
Subject: [PATCH 1/5] RHEL: mark old machine types as deprecated
dc1fe0
MIME-Version: 1.0
dc1fe0
Content-Type: text/plain; charset=UTF-8
dc1fe0
Content-Transfer-Encoding: 8bit
dc1fe0
dc1fe0
RH-Author: Cornelia Huck <cohuck@redhat.com>
dc1fe0
RH-MergeRequest: 119: RHEL: mark old machine types as deprecated
dc1fe0
RH-Commit: [1/1] 5d7531d23fac5dd67c3cc202f538b25f26393600 (cohuck/qemu-kvm)
dc1fe0
RH-Bugzilla: 2052050
dc1fe0
RH-Acked-by: Thomas Huth <thuth@redhat.com>
dc1fe0
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
dc1fe0
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
dc1fe0
dc1fe0
We want to make it obvious that we consider machine types for older
dc1fe0
RHEL major releases to be deprecated; we only carry them for
dc1fe0
compatibility purposes.
dc1fe0
dc1fe0
Let's mark all rhel-7.x and rhel-8.x machine type as deprecated via
dc1fe0
QEMU's existing deprecation mechanism; those machine types will
dc1fe0
continue to work as expected, but commands like 'virsh capabilities',
dc1fe0
'virsh dominfo', or the libvirt log will tag the machine as
dc1fe0
deprecated.
dc1fe0
dc1fe0
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
dc1fe0
---
dc1fe0
 hw/core/machine.c          | 6 ++++++
dc1fe0
 hw/i386/pc_piix.c          | 4 ++++
dc1fe0
 hw/i386/pc_q35.c           | 4 ++++
dc1fe0
 hw/s390x/s390-virtio-ccw.c | 3 +++
dc1fe0
 include/hw/boards.h        | 2 ++
dc1fe0
 5 files changed, 19 insertions(+)
dc1fe0
dc1fe0
diff --git a/hw/core/machine.c b/hw/core/machine.c
dc1fe0
index 669d3d8b91..5fae55d6cd 100644
dc1fe0
--- a/hw/core/machine.c
dc1fe0
+++ b/hw/core/machine.c
dc1fe0
@@ -37,6 +37,12 @@
dc1fe0
 #include "hw/virtio/virtio.h"
dc1fe0
 #include "hw/virtio/virtio-pci.h"
dc1fe0
 
dc1fe0
+/*
dc1fe0
+ * RHEL only: machine types for previous major releases are deprecated
dc1fe0
+ */
dc1fe0
+const char *rhel_old_machine_deprecation =
dc1fe0
+    "machine types for previous major releases are deprecated";
dc1fe0
+
dc1fe0
 /*
dc1fe0
  * Mostly the same as hw_compat_6_0 and hw_compat_6_1
dc1fe0
  */
dc1fe0
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
dc1fe0
index fccb7f5fc9..cf68d7498c 100644
dc1fe0
--- a/hw/i386/pc_piix.c
dc1fe0
+++ b/hw/i386/pc_piix.c
dc1fe0
@@ -989,6 +989,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
dc1fe0
     m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
dc1fe0
     m->async_pf_vmexit_disable = true;
dc1fe0
     m->smbus_no_migration_support = true;
dc1fe0
+
dc1fe0
+    /* All RHEL machines for prior major releases are deprecated */
dc1fe0
+    m->deprecation_reason = rhel_old_machine_deprecation;
dc1fe0
+
dc1fe0
     pcmc->pvh_enabled = false;
dc1fe0
     pcmc->default_cpu_version = CPU_VERSION_LEGACY;
dc1fe0
     pcmc->kvmclock_create_always = false;
dc1fe0
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
dc1fe0
index bf9ad32f0e..c8e06da084 100644
dc1fe0
--- a/hw/i386/pc_q35.c
dc1fe0
+++ b/hw/i386/pc_q35.c
dc1fe0
@@ -674,6 +674,10 @@ static void pc_q35_machine_rhel860_options(MachineClass *m)
dc1fe0
     pc_q35_machine_rhel900_options(m);
dc1fe0
     m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)";
dc1fe0
     m->alias = NULL;
dc1fe0
+
dc1fe0
+    /* All RHEL machines for prior major releases are deprecated */
dc1fe0
+    m->deprecation_reason = rhel_old_machine_deprecation;
dc1fe0
+
dc1fe0
     pcmc->smbios_stream_product = "RHEL-AV";
dc1fe0
     pcmc->smbios_stream_version = "8.6.0";
dc1fe0
 }
dc1fe0
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
dc1fe0
index 9da6e9b1d4..cc78a315e3 100644
dc1fe0
--- a/hw/s390x/s390-virtio-ccw.c
dc1fe0
+++ b/hw/s390x/s390-virtio-ccw.c
dc1fe0
@@ -1121,6 +1121,9 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
dc1fe0
 static void ccw_machine_rhel860_class_options(MachineClass *mc)
dc1fe0
 {
dc1fe0
     ccw_machine_rhel900_class_options(mc);
dc1fe0
+
dc1fe0
+    /* All RHEL machines for prior major releases are deprecated */
dc1fe0
+    mc->deprecation_reason = rhel_old_machine_deprecation;
dc1fe0
 }
dc1fe0
 DEFINE_CCW_MACHINE(rhel860, "rhel8.6.0", false);
dc1fe0
 
dc1fe0
diff --git a/include/hw/boards.h b/include/hw/boards.h
dc1fe0
index 3c3d2ad450..21d8d5528e 100644
dc1fe0
--- a/include/hw/boards.h
dc1fe0
+++ b/include/hw/boards.h
dc1fe0
@@ -464,4 +464,6 @@ extern const size_t hw_compat_rhel_8_0_len;
dc1fe0
 extern GlobalProperty hw_compat_rhel_7_6[];
dc1fe0
 extern const size_t hw_compat_rhel_7_6_len;
dc1fe0
 
dc1fe0
+extern const char *rhel_old_machine_deprecation;
dc1fe0
+
dc1fe0
 #endif
dc1fe0
-- 
dc1fe0
2.31.1
dc1fe0