diff mbox series

[09/14] hw: temporarily disable deletion of versioned machine types

Message ID 20240501182759.2934195-10-berrange@redhat.com
State New
Headers show
Series hw: define and enforce a standard lifecycle for versioned machines | expand

Commit Message

Daniel P. Berrangé May 1, 2024, 6:27 p.m. UTC
The new deprecation and deletion policy for versioned machine types is
being introduced in QEMU 9.1.0.

Under the new policy a number of old machine types (any prior to 2.12)
would be liable for immediate deletion which would be a violation of our
historical deprecation and removal policy

Thus automatic deletions (by skipping QOM registration) are temporarily
gated on existance of the env variable "QEMU_DELETE_MACHINES" / QEMU
version number >= 10.1.0. This allows opt-in testing of the automatic
deletion logic, while activating it fully in QEMU >= 10.1.0.

This whole commit should be reverted in the 10.1.0 dev cycle or shortly
thereafter.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 include/hw/boards.h | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

Comments

Thomas Huth May 2, 2024, 11:05 a.m. UTC | #1
On 01/05/2024 20.27, Daniel P. Berrangé wrote:
> The new deprecation and deletion policy for versioned machine types is
> being introduced in QEMU 9.1.0.
> 
> Under the new policy a number of old machine types (any prior to 2.12)
> would be liable for immediate deletion which would be a violation of our
> historical deprecation and removal policy
> 
> Thus automatic deletions (by skipping QOM registration) are temporarily
> gated on existance of the env variable "QEMU_DELETE_MACHINES" / QEMU
> version number >= 10.1.0. This allows opt-in testing of the automatic
> deletion logic, while activating it fully in QEMU >= 10.1.0.

If we include your patches now, the old machine types will be marked as 
deprecated in QEMU 9.1 and 9.2, so it should be OK to remove them in 10.0 
already, shouldn't it?

  Thomas
Daniel P. Berrangé May 2, 2024, 11:13 a.m. UTC | #2
On Thu, May 02, 2024 at 01:05:20PM +0200, Thomas Huth wrote:
> On 01/05/2024 20.27, Daniel P. Berrangé wrote:
> > The new deprecation and deletion policy for versioned machine types is
> > being introduced in QEMU 9.1.0.
> > 
> > Under the new policy a number of old machine types (any prior to 2.12)
> > would be liable for immediate deletion which would be a violation of our
> > historical deprecation and removal policy
> > 
> > Thus automatic deletions (by skipping QOM registration) are temporarily
> > gated on existance of the env variable "QEMU_DELETE_MACHINES" / QEMU
> > version number >= 10.1.0. This allows opt-in testing of the automatic
> > deletion logic, while activating it fully in QEMU >= 10.1.0.
> 
> If we include your patches now, the old machine types will be marked as
> deprecated in QEMU 9.1 and 9.2, so it should be OK to remove them in 10.0
> already, shouldn't it?

Yes, the deprecation marking still happens on the correct documented
schedule. We're merely postponing the removal to be nice.

IOW, when 10.0 arrives, we'll be able to delete everything upto and
including version 4.0, so at that point 4.1 will be the oldest
machine present.

Without this patch, we would be removing everything upto and including
3.1 straight away with no prior warning. With this patch everything
is still present, under the old deprecation 2 release policy.

With regards,
Daniel
diff mbox series

Patch

diff --git a/include/hw/boards.h b/include/hw/boards.h
index 48b6c98c77..d6214007ce 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -657,10 +657,28 @@  struct MachineState {
         } \
     } while (0)
 
+/*
+ * The new deprecation and deletion policy for versioned
+ * machine types was introduced in QEMU 9.1.0.
+ *
+ * Under the new policy a number of old machine types (any
+ * prior to 2.12) would be liable for immediate deletion
+ * which would be a violation of our historical deprecation
+ * and removal policy
+ *
+ * Thus deletions are temporarily gated on existance of
+ * the env variable "QEMU_DELETE_MACHINES" / QEMU version
+ * number >= 10.1.0. This gate can be deleted in the 10.1.0
+ * dev cycle
+ */
 #define MACHINE_VER_DELETION(...) \
     do { \
         if (MACHINE_VER_SHOULD_DELETE(__VA_ARGS__)) { \
-            return; \
+            if (getenv("QEMU_DELETE_MACHINES") || \
+                QEMU_VERSION_MAJOR > 10 || (QEMU_VERSION_MAJOR == 10 && \
+                                            QEMU_VERSION_MINOR >= 1)) { \
+                return; \
+            } \
         } \
     } while (0)