Blob Blame History Raw
From dcc64971bf25e5c2303d551fb2fef448a5e8f4fd Mon Sep 17 00:00:00 2001
From: Cornelia Huck <cohuck@redhat.com>
Date: Thu, 3 Mar 2022 10:57:37 +0100
Subject: [PATCH 1/5] RHEL: mark old machine types as deprecated
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RH-Author: Cornelia Huck <cohuck@redhat.com>
RH-MergeRequest: 119: RHEL: mark old machine types as deprecated
RH-Commit: [1/1] 5d7531d23fac5dd67c3cc202f538b25f26393600 (cohuck/qemu-kvm)
RH-Bugzilla: 2052050
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>

We want to make it obvious that we consider machine types for older
RHEL major releases to be deprecated; we only carry them for
compatibility purposes.

Let's mark all rhel-7.x and rhel-8.x machine type as deprecated via
QEMU's existing deprecation mechanism; those machine types will
continue to work as expected, but commands like 'virsh capabilities',
'virsh dominfo', or the libvirt log will tag the machine as
deprecated.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/core/machine.c          | 6 ++++++
 hw/i386/pc_piix.c          | 4 ++++
 hw/i386/pc_q35.c           | 4 ++++
 hw/s390x/s390-virtio-ccw.c | 3 +++
 include/hw/boards.h        | 2 ++
 5 files changed, 19 insertions(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 669d3d8b91..5fae55d6cd 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -37,6 +37,12 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-pci.h"
 
+/*
+ * RHEL only: machine types for previous major releases are deprecated
+ */
+const char *rhel_old_machine_deprecation =
+    "machine types for previous major releases are deprecated";
+
 /*
  * Mostly the same as hw_compat_6_0 and hw_compat_6_1
  */
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index fccb7f5fc9..cf68d7498c 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -989,6 +989,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
     m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
     m->async_pf_vmexit_disable = true;
     m->smbus_no_migration_support = true;
+
+    /* All RHEL machines for prior major releases are deprecated */
+    m->deprecation_reason = rhel_old_machine_deprecation;
+
     pcmc->pvh_enabled = false;
     pcmc->default_cpu_version = CPU_VERSION_LEGACY;
     pcmc->kvmclock_create_always = false;
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index bf9ad32f0e..c8e06da084 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -674,6 +674,10 @@ static void pc_q35_machine_rhel860_options(MachineClass *m)
     pc_q35_machine_rhel900_options(m);
     m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)";
     m->alias = NULL;
+
+    /* All RHEL machines for prior major releases are deprecated */
+    m->deprecation_reason = rhel_old_machine_deprecation;
+
     pcmc->smbios_stream_product = "RHEL-AV";
     pcmc->smbios_stream_version = "8.6.0";
 }
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 9da6e9b1d4..cc78a315e3 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1121,6 +1121,9 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
 static void ccw_machine_rhel860_class_options(MachineClass *mc)
 {
     ccw_machine_rhel900_class_options(mc);
+
+    /* All RHEL machines for prior major releases are deprecated */
+    mc->deprecation_reason = rhel_old_machine_deprecation;
 }
 DEFINE_CCW_MACHINE(rhel860, "rhel8.6.0", false);
 
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 3c3d2ad450..21d8d5528e 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -464,4 +464,6 @@ extern const size_t hw_compat_rhel_8_0_len;
 extern GlobalProperty hw_compat_rhel_7_6[];
 extern const size_t hw_compat_rhel_7_6_len;
 
+extern const char *rhel_old_machine_deprecation;
+
 #endif
-- 
2.31.1