mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
include/hw: temporarily disable deletion of versioned machine types
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> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240620165742.1711389-10-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
a35f8577a0
commit
c9fd2d9a48
1 changed files with 18 additions and 1 deletions
|
@ -686,11 +686,28 @@ struct MachineState {
|
||||||
* suitable period of time has passed, it will cause
|
* suitable period of time has passed, it will cause
|
||||||
* execution of the method to return, avoiding registration
|
* execution of the method to return, avoiding registration
|
||||||
* of the machine
|
* of the machine
|
||||||
|
*
|
||||||
|
* 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(...) \
|
#define MACHINE_VER_DELETION(...) \
|
||||||
do { \
|
do { \
|
||||||
if (MACHINE_VER_SHOULD_DELETE(__VA_ARGS__)) { \
|
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)
|
} while (0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue