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